# Choice of Particular Solution for an inhomogeneous ODE

Given the following problem:

$$y'' - t^2 y = a\cos(tx)+b\cosh(t x),$$ where $$y(0) = 1, y(1) = 2$$

The method I am using is as follows:

1) Solve the related homogeneous equation (gives $y_c = A\cosh(tx) + B\sinh(tx)$)

2) Use a particular solution to generate the general solution ($y_g = y_c + y_p$). The particular solution I am using is $$y_p = C\cos(tx) + D\cosh(tx)$$

The question I have is, am I using the correct $y_p$ ?

I don't get the solution I require so I suspect I'm using an incorrect $y_p$ but I'm not sure why?

Also, firstly, as $\cosh(t x)$ is used within $y_c$ do I need to 'adjust' it within $y_p$ with another constant to allow the Math to work? This would give $$y_p = C\cos(tx) + D w \cosh(tx)$$ Where I have added the constant $w$.

Or... should I be taking $a\cos(tx)$ and $b\cosh(t x)$ seperately and solving for each to give $y_{p1}$ and $y_{p2}$ and then adding to get $y_g = y_c + y_{p1} + y_{p2}$ ?

Thank you in advance for any pointers.

Any correct particular solution is as good as any other. If I substitute yours into the equation $y_p''-t^2y_p=-Ct^2\cos(tx)+Dt^2\cosh(tx)=-Ct^2\cos(tx)-Dt^2\cosh(tx)=-2Ct^2\cos(tx)$ which doesn't solve the equation.
You can certainly find particular solutions for each term on the right. When I feed the first to Alpha I get $y_p=\frac a{2t^2}cos(tx)$ and the second gives $y_p=\frac {bx}{2t}\sinh(tx)$
Note that, since the Wronskian equals to $t$, then it is easier to use the variation of parameters method.