# Differential Equation with forcing function

Given the ODE: $$y^{\prime\prime}(x)+25y(x)=F(x)+\frac{99}4\sin(\frac {x}{2})+\sin(5x),\quad 0<x<\pi$$ $$y(0)=0,\quad y(\pi)=1$$

Which condition does $F(x)$ have to satisfy in order for the problem to be solvable?

I took : $$y^{\prime\prime}(x)+25y(x)=F(x)$$ and after finding the solution to the homogeneous problem: $y(x)=c_1\cos(5x)+c_2\sin(5x)$, I applied variation of parameters to express the general solution as: $$y(x)=c_1\cos(5x)+c_2\sin(5x)+\frac15\int_0^xf(x^\prime)\sin[5(x^\prime+x)]dx^\prime$$ So, the general solution to the initial problem is: $$y(x)=c_1\cos(5x)+c_2\sin(5x)+\frac15\int_0^xf(x^\prime)\sin[5(x^\prime+x)]dx^\prime+sin(\frac{x}{2})-\frac1{10}x\cos(5x)$$ After that, I assume $f$ can be determined using the boundary conditions somehow. Any help?

• A hint: Take $y(\pi)=0$ in your last formula (assuming it is correct; I didn't check), and try to get as much information from it as possible (for example, $\sin(\pi/2)=1$, $-1/(10)\pi\cos(5\pi)=\pi/10$, etc.). – user539887 Jun 4 '18 at 18:41

You made a sign error. Variation of parameters should give

\begin{align} y_p &= -\frac15 \cos(5x)\int_0^x f(t)\sin (5t)\ dt + \frac15 \sin (5x)\int_0^x f(t)\cos(5t)\ dt \\ &= \frac15 \int_0^x f(t)\sin[5(x-t)]\ dt \end{align}

So the general solution is

$$y = c_1\cos(5x) + c_2\sin(5x) + \sin\left(\frac{x}{2}\right) - \frac{1}{10}x\cos(5x) + \frac15\int_0^x f(t)\sin[5(x-t)]\ dt$$

Applying the boundary conditions \begin{align} y(0) &= c_1 = 0 \\ y(\pi) &= -c_1 + 1 + \frac{\pi}{10} + \frac15 \int_0^\pi f(t)\sin(5t)\ dt = 1 \end{align}

Therefore the required condition is $$\int_0^\pi f(t)\sin(5t)\ dt = -\frac{\pi}{2}$$

• right, thank you! – Andrew Jun 6 '18 at 14:22