Solve a second order linear ODE

$$y^{''} = k^2y,y(0)=A, y^{'}(0) = B$$

I used the characteristic equation and found that $r=k,-k$.

Then the general solution is $y(x) = C_1e^{kx}+C_2e^{-kx}$.

And $y^{'}(x) = C_1ke^{kx}-C_2ke^{-kx}$

Use the initial condition I got $A=C_1+C_2$ and $B=k(C_1-C_2)$

How do I express $C_1$ and $C_2$ in terms of $A$ and $B$? Did I do something wrong in my calculation?

• You're doing fine. Two equations, two unknowns. Commented Oct 1, 2013 at 17:53
• @RonGordon, how do I solve the equation so that I can express $C_1$ and $C_2$ explicitly in terms of $A$ and $B$? Commented Oct 1, 2013 at 17:56
• It is very peculiar that you would be dealing with differential equations without being able to solve two equation in two unknowns! You have two equations, $C_1+ C_2= A$ and $k(C_1- C_2)= B$. From the first equation, $C_2= A- C_1$ so the second equation can be written as $k(C_1- (A- C_1)= 2kC_1- kA= B$. $2kC_1= kA+ B$, $C_1= (kA+ B)/2k$. Commented May 1, 2018 at 19:38

2 Answers

$$C_1+C_2=A$$ $$C_1-C_2=\frac{B}{k}$$

$$\implies 2 C_1 = A + \frac{B}{k}$$ $$\implies 2 C_2 = A - \frac{B}{k}$$

With

$A = C_1 + C_2 \tag{1}$

and

$B = k(C_1 - C_2) \tag{2}$

we have

$k^{-1}B = C_1 - C_2, \tag{3}$

assuming of course $k \ne 0$. Adding (1) and (3) yields

$2C_1 = A + k^{-1}B; \tag{4}$

subtracting them gives

$2C_2 = A - k^{-1}B, \tag{5}$

from which

$C_1 = \frac{1}{2}( A + k^{-1}B) \tag{6}$

and

$C_2 = \frac{1}{2}( A - k^{-1}B). \tag{7}$

Voila!!! $C_1, C_2$ in terms of $A$ and $B$!

Hope this helps! Cheerio,

and as always

Fiat Lux!!!