# Refreshing solving second order ODE

I have a boundary value problem for the following differential equation $$\frac{d^2 v}{d \chi^2} = q^2 \left( v - C \right), \; 0<\chi<S \; and \;\; v(0)=v(S)=0$$ where $q$ and $C$ are certain constants. As for now I got to this point $$\frac{d v^2}{d \chi^2} = q^2 \left( v - v_+ \right) \\ \frac{d}{d \chi}\left( \frac{d v}{d \chi} \right)^2 = 2 q^2 \left( v - v_+ \right) \\ \int \frac{d}{d \chi} \left( \frac{d v}{d \chi} \right)^2 = 2 q^2 \int \left( v - v_+ \right) \\ \left( \frac{d v}{d \chi} \right)^2 = 2 q^2 \left( \frac{v^2}{2} - v_+ + C_1 \right)= q^2 \left( {v^2} - 2 v_+ + 2 C_1 \right)\\ \frac{d v}{d \chi} = \pm q \sqrt{ {v^2} - 2 v_+ + 2 C_1 }$$ First question - as my boundary conditions are given on $v$ and not on the $\frac{d v}{d \chi}$ I have to now to integrate it by separation of variables, right?

• a change of variable $u = v - C$ may make it easier to solve.
– abel
Commented Jan 29, 2015 at 16:06
• @abel That is what I would do also. Commented Jan 29, 2015 at 16:25
• @abel Thanks for the tip, could you have a look if I did it correctly? $$\frac{d^2 v}{d \chi^2} = q^2 \left( v - v_+ \right) \\ \left( v - v_+ \right) = u \\ \frac{d^2 u}{d \chi^2} = q^2 u \\ \frac{1}{2} \frac{d}{du} \left( \frac{d u}{d \chi} \right)^2 = q^2 u \\ \int \frac{d}{d \chi} \left( \frac{d u}{d \chi} \right)^2 = 2 q^2 \int u \frac{d u }{d \chi} \\ \frac{d u}{d \chi} = q \sqrt{u^2 + C_1^2} \\ \frac{d u}{\sqrt{u^2 + C_1^2}} = q d \chi \\ \int \frac{d u}{\sqrt{u^2 + C_1^2}} = q \int d \chi \\ \sinh^-1 \left( \frac{y}{C_1} \right) = \left( q \chi + C_2 \right)$$
– Ohm
Commented Jan 31, 2015 at 10:09
• two independent solutions of $\frac{d^2y}{dx^2} = k^2 y$ are $y = e^{kx}, e^{-kx}.$ you don't need to do the long way you have done.
– abel
Commented Jan 31, 2015 at 13:56
• @abel great, it was indeed the easier way to go :)
– Ohm
Commented Feb 1, 2015 at 8:51

Indeed the easiest way to go is to make the change of variable $u = (v - v_+)$, and then to find an answer of the sort $u = A \exp(q \chi) + B\exp(-q \chi)$. Adding the boundary conditions $v(0)=v(-s_+)=0$ we get $$v_+ + A + B = 0\\ v_+ + A\exp(-s_+ q) + B\exp(s_+ q)$$ We find $A$ and $B$ and bingo we have a solution!
The first step should be $$\dfrac{d}{d\chi}\left(\frac{dv}{d\chi}\right)^2 = 2q^2(v-C)\frac{dv}{d\chi} = 2q^2\dfrac{d}{d\chi}\left(\frac{v^2}{2}-Cv\right)$$ Then follow it through.
• $$\int \dfrac{d}{d\chi}\left(\frac{dv}{d\chi}\right)^2 = 2q^2 \int \dfrac{d}{d\chi}\left(\frac{v^2}{2}-Cv\right) \\ \left(\frac{dv}{d\chi}\right)^2 = 2q^2 \left(\frac{v^2}{2}-Cv + K_1\right) \\ \left(\frac{dv}{d\chi}\right) = q \sqrt{{v^2} -2Cv + 2 K_1} \\ \int \frac{dv}{\sqrt{{v^2} -2Cv + 2 K_1}} = q d\chi = q \chi + K_2$$ But now I don't get any hyperbolic trigonometric function that can do the job..