TITLE: If $y_1$ and $y_2$ are two special different answers for the equation below, and $y_1=y_2+f(x)$, then how to find $f(x)$?
QUESTION [0 upvotes]: $$y''+y'-2y=\sin(\exp(\cos x)+\cosh(x^3-x+\sqrt2))$$
I probably should use parametric change and wronskian
But the problem is the right side with the long sin and I can't figure out how to solve it.

REPLY [0 votes]: The right-hand side is defined and continuous everywhere (because composition and sum of continuous functions are continuous). Existence-Uniqueness Theorem says that a unique solution exists (on all of $\mathbb{R})$ for any initial condition $$y(x_0) = y_0, \quad y'(x_0)=y'_0$$
After this point, the function at the right-hand side doesn't really matter.
Suppose that $y_1$ and $y_2$ are solutions to the given ODE:
$$y_1''+y_1'-2y_1 = p(x)$$
$$y_2''+y_2'-2y_2 = p(x)$$
Then
$$
\begin{align}
(y_1-y_2)''+(y_1-y_2)'-2(y_1-y_2)&=(y_1''+y_1'-2y_1)-(y_2''+y_2'-2y_2)\\
&=p(x) - p(x)\\
&=0.
\end{align}
$$
This shows that $y_1 - y_2$ must be a solution of the homogeneous equation $$y_c'' + y_c' - 2y_c = 0.$$
All solutions to this equation have the form $$y_c = c_1 e^{-2x} + c_2e^{x}.$$
This is the general form of $y_1 - y_2 = f(x)$.
$y_c$ is called the complementary solution. It can be shown that if $y_p$ is any particular solution to the original non-homogeneous ODE, then so is $y_p + y_c$ for all $y_c$. (Put $y_p + y_c$ in the left-hand side and use the linearity, just like the calculation above)
{"set_name": "stack_exchange", "score": 0, "question_id": 4172909}