Solve boundary value problem $\frac{d^2 y}{dx^2} = f(x)$

I would like to solve the boundary value problem $\frac{d^2 y}{dx^2} = f(x)$ with initial conditions $$y(-1)=y(1)=0$$ My thoughts were to try to find the solution without the conditions, and then filling in this solution in the differential equation to find all the right constants. However, I'm stuck.

I thought the following: $$y(x) = A + Bx + \int_{x_0}^x \left(\int_{x_0}^\eta f(\xi)d\xi \right)d\eta$$

But how can I proceed?

• Simply plug the initial conditions to get the values of $A$ and$B$. – Yves Daoust Mar 30 '17 at 11:52
• If you have power series representation of $f(x)$ then yes A and B like that should do nicely because there will be nothing left from $f$ for those coefficients in the power series. – mathreadler Mar 30 '17 at 11:53
• @YvesDaoust, Yes I know I'm supposed to, but I don't know how to plug this in in the double integral – Di-lemma Mar 30 '17 at 12:15
• Replace $x$ by its value. – Yves Daoust Mar 30 '17 at 12:29
• $$A=-\frac{(F(-1)+F(1))}{2}$$ $$B=F(1)-A=F(1)+\frac{(F(-1)+F(1))}{2}=F(1)+\frac{F(-1)}{2}$$ With $F(x)=\int_{x_{0}}^{x}\Big(\int_{x_{0}}^{\nu}f(\xi)d\xi\Big)d\nu$ – Kiryl Pesotski Mar 30 '17 at 12:31