# Solve Simple Differential Equations

This is a tutorial on solving simple first order differential equations of the form
\( \)\( \)\( \)
\[ \dfrac{dy}{dx} = 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 with Solutions

### Example 1:

Solve and find a general solution to the differential equation.
\[ \dfrac{dy}{dx} = 2x + 1 \]
__Solution to Example 1:__

Integrate both sides of the equation.
\[ \int y' \, dx = \int (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\dfrac{dy}{dx} = \sin(2x) \]
__Solution to Example 2:__

Write the differential equation of the form \( y' = f(x) \).
\[ y' = \dfrac{1}{2} \sin(2x) \]
Integrate both sides
\[ \int y' \, dx = \int \dfrac{1}{2} \sin(2x) \, dx \]
Let \( u = 2x \) so that \( du = 2 dx \), the right side becomes
\[ y = \int \dfrac{1}{4} \sin(u) \, du \]
Which gives
\[ y = -\dfrac{1}{4} \cos(u) = -\dfrac{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 \), simplify and write the differential equation of the form \( y' = f(x) \).
\[ y' = -e^{3x} \]
Integrate both sides of the equation
\[ \int y' \, dx = \int -e^{3x} \, dx \]
Let \( u = 3x \) so that \( du = 3 dx \), write the right side in terms of \( u \)
\[ y = \int -\dfrac{1}{3} e^{u} \, du \]

Which gives
\[ y = -\dfrac{1}{3} e^{u} = -\dfrac{1}{3} e^{3x} \]

## Exercises

Solve the following differential equations.

a) \( 2\dfrac{dy}{dx} = 6x \)

b) \( y' \cos(x) = \sin(2x) \)

c) \( y' e^{x} = e^{3x} \)

__Solutions to the above exercises__

a) \( y = \dfrac{3}{2} x^2 + C \)

b) \( y = -2 \cos(x) + C \)

c) \( y = \dfrac{1}{2} e^{2x} + C \)

## More References and Links

Differential Equations

Differential Equations - Runge Kutta Method