Steply

Solve dy/dx = 2sin(x) + 2cos(x), y(0) = 0

Step by step, with the reason for every step · Integrals as solutions · Differential Equations

Step by step

The question

Question: solve dy/dx = 2sin x + 2cos x, with y(0) = 0.

dydx = 2sin x + 2cos x

y(0) = 0 is the starting value: when x is 0, y is 0.

y(0) = 0

1 The idea

dy/dx is only about x.

So y is a function whose derivative is 2sin x + 2cos x: an antiderivative.

y′ = 2sin x + 2cos x: y is a function whose derivative is 2sin x + 2cos x

2 Integrate both sides

Integrate both sides.

The left side, the integral of dy/dx, is just y.

y = ∫ (2sin x + 2cos x) dx

The rules, one for each kind of term.

∫ cos(bx) dx = sin(bx)b
∫ sin(bx) dx = −cos(bx)b

Each term by its rule, and one + C: the number we cannot see after a derivative.

y = 2 × (−cos x1) + 2 × sin x1 + C

Tidy the numbers: y = −2cos x + 2sin x + C.

y = −2cos x + 2sin x + C

Careful!

Don't forget + C.

Every number C gives another solution, and we need C to use the starting value.

Careful: not y = −2cos x + 2sin x ✗

3 Use the starting value

Put in x = 0 and y = 0.

0 = −2cos 0 + 2sin 0 + C
cos 0 = 1

Work out the numbers: −2.

0 = −2 + C

To get C alone, add 2 on both sides.

0 + 2 = C

So C = 2.

C = 2

Put C back.

The answer: y = −2cos x + 2sin x + 2.

y = −2cos x + 2sin x + 2

4 Check

Let's check: the derivative of our answer is 2sin x + 2cos x.

The right side again.

Right!

y′ = 2sin x + 2cos x

And at x = 0, y is 0: the starting value.

Right!

y(0) = 0

Let's look back.

First: the idea.

Then: integrate both sides.

Then: use the starting value.

Last: check.

Answer
y = −2cos x + 2sin x + 2

Your turn

Try this one yourself, then check:

dydx = 3sin x + 3cos x
Show the answer
y = −3cos x + 3sin x + 3

More from Integrals as solutions

The whole lesson: Integrals as solutions →