Differential Equations

Differential Equations: An Introduction with Examples

Differential Equations: An Introduction with Examples

A differential equation is an equation involving an unknown function and its derivatives, such as ( frac{dy}{dx} = ky ). Solving it means finding the function, here ( y = Ce^{kx} ). First-order equations are usually solved by separating the variables or with an integrating factor; equations with no formula solution are approximated numerically, for example with Euler’s method.

A differential equation is an equation that involves an unknown function and its derivatives. Instead of asking “what number is x?”, it asks “what function ( y(x) ) makes this relationship true?”

$$frac{dy}{dx} = 3y$$

says the rate of change of y is always three times y. The answer isn’t a number; instead, it’s the family of functions ( y = Ce^{3x} ). Differential equations are how science writes down laws of change: population growth, cooling, motion under forces, the spread of a disease, the charge on a capacitor.

Vocabulary

TermMeaningExample
Ordinary (ODE)one independent variable( y’ = x + y )
Partial (PDE)several independent variables( u_t = u_{xx} )
Orderhighest derivative present( y” + y = 0 ) is second order
Lineary and its derivatives appear only to the first power, not multiplied together( y’ + 2y = e^x )
General solutioncontains arbitrary constants( y = Ce^{3x} )
Particular solutionconstants fixed by a condition( y = 5e^{3x} )
Initial value problemequation plus starting value( y’ = 3y, y(0) = 5 )

Checking a solution

You can always verify a proposed solution by substituting it.

Example 1. Is ( y = e^{2x} + 3 ) a solution of ( y’ = 2y – 6 )?

Left side: ( y’ = 2e^{2x} ). Right side: ( 2(e^{2x} + 3) – 6 = 2e^{2x} ). They match, so yes.

Separable equations

If you can write the equation as ( frac{dy}{dx} = g(x)h(y) ), you can separate the variables and integrate each side:

Differential equations: Two people writing complex math and science equations on a blackboard

$$int frac{dy}{h(y)} = int g(x),dx$$

Example 2. Solve ( frac{dy}{dx} = 3y ), ( y(0) = 5 ).

Separate: ( frac{dy}{y} = 3,dx ). Integrate: ( ln|y| = 3x + C ). Exponentiate: ( y = Ae^{3x} ), where ( A = pm e^C ). The initial condition gives ( A = 5 ), so

$$y = 5e^{3x}$$

The integral on the left is the integral of 1/x, which is why natural logs and exponentials fill this subject.

Example 3. Solve ( frac{dy}{dx} = frac{x}{y} ), ( y(0) = 2 ).

Separate: ( y,dy = x,dx ). Integrate: ( frac{y^2}{2} = frac{x^2}{2} + C ), so ( y^2 = x^2 + K ). With ( y(0) = 2 ), ( K = 4 ), and since y starts positive, ( y = sqrt{x^2 + 4} ).

First-order linear equations

A first-order linear equation has the form ( y’ + P(x)y = Q(x) ). Multiply through by the integrating factor ( mu(x) = e^{int P(x),dx} ). The left side then becomes the derivative of a product, ( (mu y)’ ), by the product rule, and you can integrate directly.

Example 4. Solve ( y’ + 2y = 4 ), ( y(0) = 0 ).

The integrating factor is ( e^{2x} ). Multiply: ( e^{2x}y’ + 2e^{2x}y = 4e^{2x} ), which is ( (e^{2x}y)’ = 4e^{2x} ). Integrate: ( e^{2x}y = 2e^{2x} + C ), so ( y = 2 + Ce^{-2x} ). From ( y(0) = 0 ), ( C = -2 ):

$$y = 2 - 2e^{-2x}$$

As ( x to infty ), y approaches 2, the equilibrium where ( y’ = 0 ).

Models you’ll meet

Exponential growth and decay

( frac{dP}{dt} = kP ) gives ( P = P_0e^{kt} ). Positive k means growth, negative k decay. A substance with half-life 30 years has ( k = -frac{ln 2}{30} approx -0.0231 ), so 100 g becomes about 50 g after 30 years. Try it in the exponential growth calculator, and see exponential functions for the algebra.

Exponential growth and decay

Newton’s law of cooling

( frac{dT}{dt} = -k(T – T_{text{room}}) ). The temperature difference decays exponentially: ( T = T_{text{room}} + (T_0 – T_{text{room}})e^{-kt} ). Coffee at 90°C in a 20°C room with ( k = 0.05 ) per minute is at ( 20 + 70e^{-0.5} approx 62.5 )°C after 10 minutes.

Logistic growth

( frac{dP}{dt} = rPleft(1 – frac{P}{K}right) ). Growth is nearly exponential when P is small and levels off at the carrying capacity K. Separating variables and using partial fractions gives the solution

$$P(t) = frac{K}{1 + Ae^{-rt}}, qquad A = frac{K - P_0}{P_0}$$

Example. A population with ( K = 1000 ), ( P_0 = 100 ) and ( r = 0.5 ) per year has ( A = 9 ). After 4 years, ( P = frac{1000}{1 + 9e^{-2}} approx 451 ); after 10 years, about 943, approaching but never passing 1000. The curve is S-shaped, and growth is fastest when ( P = frac{K}{2} ).

Motion

Newton’s second law is a second-order differential equation: ( mfrac{d^2x}{dt^2} = F ). With constant force it gives the kinematic equations. A spring gives ( x” = -omega^2x ), whose solutions are ( x = Acosomega t + Bsinomega t ).

When you can’t solve it: Euler’s method

Most differential equations have no formula solution. However, Euler’s method approximates one by taking small straight-line steps along the slope the equation gives:

$$y_{n+1} = y_n + h,f(x_n, y_n)$$

The calculator below applies it to ( y’ = y ), ( y(0) = 1 ), whose exact solution is ( e^x ). With step ( h = 0.1 ), Euler gives ( y(1) approx 2.5937 ), against the true value ( e approx 2.7183 ). Smaller steps get closer.

Physics & Applied#24

Euler's Method ODE Solver

Approximates \(y' = F(x, y)\) step by step, compared with RK4.

The Euler’s method guide explains the error and how to reduce it, and the Euler’s method calculator shows the full table.

Slope fields

A slope field draws a short line segment at many points ( (x, y) ), each with slope ( f(x, y) ). Solution curves follow the segments like iron filings follow a magnetic field. They let you see the long-term behavior (growth, decay, approach to an equilibrium) without solving anything.

Common mistakes

  • Dropping the constant too early. Add ( + C ) when you integrate, then use the initial condition.
  • Losing solutions when dividing. Dividing by y in ( y’ = 3y ) hides the solution ( y = 0 ); the constant ( A = 0 ) recovers it.
  • Misapplying separation. ( y’ = x + y ) is not separable; it’s linear, so use an integrating factor.
  • Forgetting to check. Substituting your answer back takes a minute and catches most errors.

Practice problems

  1. Verify that ( y = sin x ) solves ( y” + y = 0 ).
  2. Solve ( frac{dy}{dx} = -2y ), ( y(0) = 7 ).
  3. Solve ( frac{dy}{dx} = 6x^2 ), ( y(1) = 4 ).
  4. Solve ( frac{dy}{dx} = xy ), ( y(0) = 1 ).
  5. Solve ( y’ + y = 3 ), ( y(0) = 1 ).
  6. What is the order of ( y”’ – 4y’ = x )?

Answers: (1) ( y” = -sin x ), so ( y” + y = 0 ); (2) ( y = 7e^{-2x} ); (3) ( y = 2x^3 + 2 ); (4) ( y = e^{x^2/2} ); (5) ( y = 3 – 2e^{-x} ); (6) third order.

A study desk with handwritten math notebooks, pens, and a booklet

FAQ

What is a differential equation in simple terms?

An equation that describes how a quantity changes. Solving it means finding the function that changes in exactly that way.

What is the difference between an ODE and a PDE?

An ordinary differential equation has one independent variable, such as time. A partial differential equation has several, such as time and position, and uses partial derivatives.

Is differential equations harder than calculus?

It builds directly on calculus, especially integration. Students who are comfortable with integrals usually find introductory differential equations very approachable.

What are differential equations used for?

Physics, engineering, biology, chemistry, economics and epidemiology. Any law that describes a rate of change is a differential equation.

Do all differential equations have solutions?

Under mild conditions an initial value problem has exactly one solution, but it often can’t be written as a formula. Numerical methods like Euler’s method approximate it.

Further reading

Calculators for this topic

Leave a comment

Your email address will not be published. Required fields are marked *