# Solve Simple Differential Equations

This is a tutorial on solving simple first order differential equations of the form

y ' = f(x)
A set of examples with detailed solutions is presented and a set of exercises is presented after the tutorials. Depending on f(x), these equations may be solved analytically by integration. In what follows C is a constant of integration and can take any constant value.

## Examples

Example 1: Solve and find a general solution to the differential equation.
y ' = 2x + 1
Solution to Example 1:
Integrate both sides of the equation.
ò y ' dx = ò (2x + 1) dx
which gives
y = x 2 + x + C.
As a practice, verify that the solution obtained satisfy the differential equation given above.

Example 2: Solve and find a general solution to the differential equation.
2 y ' = sin(2x)
Solution to Example 2:
Write the differential equation of the form y ' = f(x).
y ' = (1/2) sin(2x)
Integrate both sides
ò y ' dx = ò (1/2) sin(2x) dx
Let u = 2x so that du = 2 dx, the right side becomes
y = ò (1/4) sin(u) du
Which gives.
y = (-1/4) cos(u) = (-1/4) cos (2x)

Example 3: Solve and find a general solution to the differential equation.
y 'e -x + e 2x = 0
Solution to Example 3:
Multiply all terms of the equation by e x and write the differential equation of the form y ' = f(x).
y ' = - e 3x
Integrate both sides of the equation
ò y ' dx = ò - e 3x dx
Let u = 3x so that du = 3 dx, write the right side in terms of u
y = ò (-1/3) e u du
Which gives.
y = (-1/3) e u = (-1/3) e 3x

## Exercises

Solve the following differential equations.
a) 2y ' = 6x
b) y ' cos x = sin(2x)
c) y ' e
x = e 3x

Solutions to the above exercises
a) y = (3/2) x
2 + C
b) y = -2 cos x + C
c) y =(1 / 2) e
2x + C

More references on Differential Equations
Differential Equations - Runge Kutta Method