# Particular solution to a nonhomogenous differential equation

Consider the following ODE:

$$\frac{d^2 x}{dt^2} + kx = f(t)$$

where $$f(t) = \frac{1}{2} +\sum_{n = 1}^{\infty}{ \frac{-4}{n \pi} \sin\left(\frac{n \pi t}{2}\right)}$$ was derived using fourier series.

I have to find a particular solution. The sum symbol confuses me on this one but I will treat it as one does normally when looking to find a particular solution.

My thoughts:

Guess the solution: $$x(t) = A_1 t+ A_0 + \sum_{n = 1}^{\infty}{ B \sin\left(\frac{n \pi t}{2}\right) + C \cos\left(\frac{n \pi t}{2}\right)}$$

After taking the second derivative and matching coefficients I arrive to the conclusion that the coefficients of the particular solution are:

$$A_1 = 0$$

$$A_0 = \frac{1}{2k}$$

$$C = 0$$

$$B = - \frac{4}{(k - m (\frac{n \pi}{2})^2)n \pi}$$

Assuming the first and second derivatives are correct is this a correct approach?

• Looks ok to me. I guess you have $k>0$ You can also set $k=\lambda ^2$ and use variation of parameters. – Matematleta Dec 12 '15 at 16:17
• @Chilango Undetermined comes easier to me. Relieved to know that its right :) Thanks! – DoubleOseven Dec 12 '15 at 16:20
• if you use variation of parameters you will see the integrals are all easy because they are of the form sin/sin, sin/cos, etc – Matematleta Dec 12 '15 at 16:27
• @Chilango I was thinking about $B$. Should I use the sum operator on when determining the coefficients? – DoubleOseven Dec 13 '15 at 12:14
• is your diff eq an initial value problem?A boundary value problem? – Matematleta Dec 13 '15 at 15:41