SimuveliqLearnEspañolOpen the simulators
Learn › Math

Ordinary differential equations

A differential equation relates a function to its derivatives: it describes how something changes (a temperature that cools, the charge of a capacitor, a mass that oscillates). This topic explains first-order separable and linear equations, second-order equations with constant coefficients and initial conditions.

What a solution is

A solution of is a function that satisfies it. The order is that of the highest derivative. The general solution has as many arbitrary constants as the order (, or and …): it is a family of curves. Initial conditions (, …) pick one curve of the family: the particular solution.

Geometrically, gives the slope at every point of the plane (the slope field); a solution is a curve that follows that slope at every point.

First order

Separable: . Separate the variables and integrate each side:

Linear: . Multiply by the integrating factor , which turns the left side into the derivative of a product: , and it is enough to integrate.

Second order with constant coefficients

For , try : this leaves the characteristic equation , and its roots give the solution:

RootsGeneral solutionBehavior
distinct real , exponential, no oscillation (overdamped)
double the borderline case (critical damping)
complex oscillates with frequency (underdamped if )
distinct real rootsr = −1, −2double rootr = −1, −1complex rootsr = −0.25 ± 2i
The three cases with and : this is what happens to a mass on a spring with a lot of, just enough or little damping.

If the right side is not 0 (a nonhomogeneous equation), the solution is : that of the homogeneous one plus a particular one. By undetermined coefficients, is tried with the shape of the right side: a polynomial for a polynomial, for , for a sine or cosine; if that shape is already in , multiply by .

The multi-domain simulator solves these same equations numerically when they come from a circuit or a mechanical or thermal system; here they are obtained in exact form. Every solution the calculator gives is substituted into the equation before it is shown.

Common mistakes

  • Forgetting the constant when integrating, or putting it on one side only and then losing it while solving for .
  • Using the integrating factor without first writing the equation as (the coefficient of must be 1).
  • Applying the initial conditions to instead of to the full solution .
  • With a double root, writing (that is a single constant): the is missing.

Worked examples

Example 1A separable equation

Solve .

Solution

  1. Separate: . Integrating: .
  2. ; with (and , also a solution): .

Solve it in Simuveliq

  1. In Math → Symbolic calculator, topic Series and differential equations, operation Differential equations: type y'=x y; press Compute. The Answer is .
  2. The calculator sees it as linear () and uses the integrating factor : the result is the same.

Example 2First-order linear

Solve .

Solution

  1. , so : .
  2. → .
  3. Check: ✓.

Solve it in Simuveliq

  1. In Math → Symbolic calculator, topic Series and differential equations, operation Differential equations: type y'+2y=e^x; press Compute. The Answer is .
  2. The calculator uses (characteristic root and , with ): the same result by another route.

Example 3A cooling coffee

A coffee at 90 °C is left in a room at 20 °C and cools according to , with in minutes. Find , the temperature after 10 min and when it reaches 40 °C.
01020304020406080100t (min)T (°C)room: 20 °C(10, 45.75)

Solution

  1. It is separable (and linear): → → .
  2. → : .
  3. °C. For : → min.
; 45.75 °C at 10 min; 40 °C at 12.53 min.

Solve it in Simuveliq

  1. In Math → Symbolic calculator, topic Series and differential equations, operation Differential equations: type y'=-0.1(y-20) and, in Initial conditions (optional), y(0)=90; press Compute. The Answer is (the calculator calls the time and the temperature ).

Example 4Distinct real roots

Solve .

Solution

  1. Characteristic: → , .
  2. : both exponentials decay, with no oscillation.

Solve it in Simuveliq

  1. In Math → Symbolic calculator, topic Series and differential equations, operation Differential equations: type y''+3y'+2y=0; press Compute. The Answer is .

Example 5With initial conditions

Solve with and .

Solution

  1. From the general one: and .
  2. Subtracting: , . It is the first curve of the three-cases figure.

Solve it in Simuveliq

  1. In Math → Symbolic calculator, topic Series and differential equations, operation Differential equations: type y''+3y'+2y=0 and, in Initial conditions (optional), y(0)=1, y'(0)=0; press Compute. The Answer is .

Example 6Double root

Solve .

Solution

  1. : double root .
  2. One exponential alone is missing an independent solution: the second is . .

Solve it in Simuveliq

  1. In Math → Symbolic calculator, topic Series and differential equations, operation Differential equations: type y''-2y'+y=0; press Compute. The Answer is .

Example 7Complex roots: oscillation

Solve (a mass on a spring without friction).

Solution

  1. → : , .
  2. : it oscillates without damping, with angular frequency 2 (period ).

Solve it in Simuveliq

  1. In Math → Symbolic calculator, topic Series and differential equations, operation Differential equations: type y''+4y=0; press Compute. The Answer is .

Example 8Nonhomogeneous: undetermined coefficients

Solve .

Solution

  1. Homogeneous: → .
  2. Particular: try ( is not in ). → , .
  3. .

Solve it in Simuveliq

  1. In Math → Symbolic calculator, topic Series and differential equations, operation Differential equations: type y''+y=sin(2x); press Compute. The Answer is .

Related topics