Steply

Solve y'' + y = 0, y(0) = 3, y'(0) = -1

Step by step, with the reason for every step · Second order · Differential Equations

Step by step

The question

Question: solve y″ + y = 0, with y(0) = 3 and y′(0) = −1.

y″ + y = 0

The starting values: at x = 0, y is 3 and its slope y′ is −1.

y(0) = 3, y′(0) = −1
second order, linear, constant numbers, 0 on the right

1 Try y = e to the rx

The derivatives of e to the rx are e to the rx again, times r.

So we try y = e^(rx), and look for the right r.

y = e^(rx): each derivative keeps the same shape
y = e^(rx)

Its derivative: r e^(rx).

y′ = re^(rx)

Once more: r² e^(rx).

y″ = r2e^(rx)

2 The characteristic equation

Put them into the equation.

r2e^(rx) + e^(rx) = 0

Every term has e^(rx): take it out.

e^(rx)(r2 + 1) = 0

e to a power is never 0.

So the bracket must be 0.

e^(rx) is never 0

r² + 1 = 0: the characteristic equation.

y″ became r², y′ became r, y became 1.

r2 + 1 = 0

3 Solve for r

It does not factor nicely, so we use the formula, with a = 1, b = 0, c = 1.

r = −b ± √b² − 4ac2a

Put the numbers in.

r = 0 ± √0² − 4 × 1 × 12 × 1

Under the root: −4.

r = 0 ± √−42

A minus under the root: √(−4) = 2i, because i = √(−1).

√−4 = √4 × √−1 = 2i
r = 0 ± 2i2

Divide both parts by 2: r = ±i.

Two complex roots.

r = ±i

Careful!

Use the root, 1, not the number under it.

Careful: not cos(1x) ✗

4 Write the solution

Complex roots give cosines and sines.

The real part 0 goes in the e, the 1 goes inside cos and sin.

α ± βi: e^(αx)(C₁cos βx + C₂sin βx)

So y = C₁cos x + C₂sin x.

y = C1cos x + C2sin x

5 Use the starting values

We need y′ too: the derivative of our y.

y′ = −C1sin x + C2cos x
at x = 0: e^(0) = 1, cos 0 = 1, sin 0 = 0

Put x = 0 into y: C₁ = 3.

So C₁ is known at once.

① C1 = 3

Put x = 0 into y′: C₂ = −1.

② C2 = −1

So C₂ = −1.

C2 = −1

Put them in: y = 3cos x − sin x.

y = 3cos x − sin x

6 Check

Let's check one root, i.

Square it, with i² = −1: −1.

r = i: r² = −1

Into r² + 1: the numbers cancel and the i parts cancel.

0.

Right!

−1 + 1 = 0

And the starting values: y(0) = 3 and y′(0) = −1.

Right!

y(0) = 3, y′(0) = −1

Let's look back.

First: try y = e to the rx.

Then: the characteristic equation.

Then: solve for r.

Then: write the solution.

Then: use the starting values.

Last: check.

Answer
y = 3cos x − sin x

Your turn

Try this one yourself, then check:

Solve y″ + y = 0
Show the answer
y = 2sin x

More from Second order

The whole lesson: Second order →