Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 39 ยท Getting Started

What Is a Differential Equation?

Learn what a differential equation is, how to classify ODEs and PDEs by order and linearity, and how to check that a function is a solution, with Python and SymPy.

A differential equation is an equation that relates a function to its own derivatives. Instead of asking "what number x satisfies this?", you ask "what function y(t) satisfies this?". The unknown is a whole curve, and the equation describes how that curve changes from point to point.

This matters because nature is written in rates of change. A cooling cup of coffee loses heat faster when it is hotter, a population grows faster when it is bigger, a spring pulls harder when it is stretched further. Each sentence is a differential equation in disguise. In this lesson you learn the vocabulary (order, linearity, ODE versus PDE, general versus particular solution) and the most important skill of the whole course: checking whether a candidate function really is a solution.

An equation about a function

Compare two questions. First: solve x**2 - 5*x + 6 = 0. The answer is two numbers, x = 2 and x = 3. Second: find every function y(t) such that y'(t) = 2*y(t). The answer is a whole family: y(t) = C*e**(2*t) for any constant C. You can verify it by differentiating: the derivative of C*e**(2*t) is 2*C*e**(2*t), which equals 2*y.

Notice the constant C. Solving a differential equation means undoing a derivative, and undoing a derivative always leaves a constant behind, exactly like an indefinite integral. Later, an initial condition such as y(0) = 5 pins C down to one value (here C = 5). We cover that in initial value problems.

Python Check a candidate solution

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The pattern is always the same: substitute the candidate into the equation and simplify. If the left side minus the right side is identically zero, the candidate is a solution. That "residual" idea returns in numerical methods.

Order, ODE and PDE

An ordinary differential equation (ODE) involves a function of one independent variable, so only ordinary derivatives appear. A partial differential equation (PDE) involves a function of several variables and partial derivatives. The heat equation u_t = k*u_xx is a PDE. This course starts with ODEs and reaches PDEs near the end.

The order of an equation is the highest derivative that appears.

Equation Order
y' = 3*y 1
y'' + 4*y = 0 2
y''' - y' = sin(t) 3
(y')**2 + y = t 1 (the power of the derivative does not matter)

Order tells you how many constants the general solution contains and how many initial conditions you need. A first-order equation has one constant, a second-order equation has two.

Linear versus nonlinear

An ODE is linear if the unknown function and all its derivatives appear only to the first power, are not multiplied together, and are not inside other functions like sin(y). The general linear equation of order n looks like

a_n(t)*y^(n) + ... + a_1(t)*y' + a_0(t)*y = g(t).

The coefficients a_k(t) can be any functions of t; only y and its derivatives must stay "simple". Examples:

  • y' + t*y = sin(t) is linear (the coefficient t depends on t, not on y).
  • y' = y**2 is nonlinear (y is squared).
  • y'' + sin(y) = 0 is nonlinear (the pendulum equation, y inside a sine).
  • y*y' = t is nonlinear (y times y').

Linear equations are special because solutions can be added together: if y1 and y2 solve a linear homogeneous equation (right side zero), so does a*y1 + b*y2. This superposition principle is the engine behind chapter 3. Nonlinear equations have no such rule, which is why they are far harder and why numerical methods matter.

An equation is autonomous if t does not appear explicitly: y' = f(y). It is homogeneous (in the linear sense) if the forcing term g(t) is zero.

General, particular and singular solutions

The general solution contains arbitrary constants and describes the whole family. A particular solution fixes the constants, usually with initial conditions. Occasionally an equation also has a singular solution that is not in the family at all. For y' = 2*sqrt(y) the family is y = (t + C)**2, but y = 0 is also a solution and no choice of C produces it.

Python Let SymPy find the general solution

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that the first-order equations produce one constant C1 and the second-order one produces C1 and C2, matching the rule above.

Solutions in explicit and implicit form

Sometimes you cannot solve for y. The equation y' = -x/y has solutions satisfying x**2 + y**2 = C, a family of circles. That is an implicit solution: it defines y indirectly, and on each half circle you can still solve for y = ยฑsqrt(C - x**2). Both forms count as solutions, and sometimes the implicit form is the best you can get. Be careful about the interval of validity: y = sqrt(C - x**2) only exists for |x| <= sqrt(C).

Classification checklist

When you meet a new equation, ask in order:

  1. ODE or PDE?
  2. What is the order?
  3. Linear or nonlinear?
  4. Are there initial or boundary conditions?
  5. Is it autonomous or does t appear explicitly?

The answers choose your method. The next chapters are organized exactly around these questions.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the order of y''' + 2*(y')**5 = t?

    Order is the highest derivative, here y''' (third). The power 5 on y' does not change the order.
  2. 2. Which equation is linear?

    In a linear equation y and its derivatives appear to the first power and only multiplied by functions of t. The coefficient t**2 is fine.
  3. 3. How many arbitrary constants does the general solution of a second-order ODE contain?

    Each order of integration contributes a constant, so an n-th order equation has n constants.
  4. 4. How do you check that a function is a solution?

    Substitution is the definitive test: the residual (left side minus right side) must simplify to zero.

Summary

  • A differential equation relates an unknown function to its derivatives; solving it means finding the function.
  • The order is the highest derivative present; an ODE has one independent variable, a PDE has several.
  • Linear equations keep y and its derivatives to the first power and unmultiplied; superposition holds for linear homogeneous ones.
  • A general solution has as many constants as the order; initial conditions select a particular solution.
  • Always verify a solution by substituting it back.

Next: Direction Fields and Solution Curves