<s>[INST] Solution to second order nonlinear ODE I need to find and exact solution for the following ODEs $$y''=-3y'+2y+2x+3,\qquad y(0)=2$$ $$y(1)=-4+5\exp\left(-3/2+\left(\sqrt{17}\right)/2\right)$$ and  $$y''=2y^3-6y-2x^3;$$ $$1\leq x\leq2;$$ $$y(1)=2;$$ $$y(2)=5/2$$ 
 [/INST] First equation $y''+3y'-2y=2x+3$ has a solution which is a sum of solution to the homogeneous ODE $y''+3y'-2y=0$ and a particular solution of inhomogeneous problem. By solving the characteristic equation $a^2+3a-2=0$, we can easily check that roots are $\frac{-3\pm\sqrt{17}}{2}$. Therefore, solution to this problem is $C_1e^{\frac{-3+\sqrt{17}}{2}x}+C_2e^{\frac{-3-\sqrt{17}}{2}x}$. Particular solution is $-x-3$ (particular solution has the form $ax+b$; by replacing in equation and solving, we get: $a=-1$, $b=-3$). Solution to the first problem is $C_1e^{\frac{-3+\sqrt{17}}{2}x}+C_2e^{\frac{-3-\sqrt{17}}{2}x}-x-3$. After evaluation $y(0)$, $y(1)$, we get the following sistem
$$C_1+C_2-3=2,$$
$$C_1e^{\frac{-3+\sqrt{17}}{2}}+C_2e^{\frac{-3-\sqrt{17}}{2}}-1-3=-4+5e^{\frac{-3+\sqrt{17}}{2}},$$ from where we get $C_1=5$, $C_2=0$. Final solution is $5e^{\frac{-3+\sqrt{17}}{2}x}-x-3$.
</s>