Linear first-order ODEs
About this app
y′ + p(x)·y = q(x) in four steps: the homogeneous family y_h = C·e^(−P(x)) by separation, variation of constants with a runner that wanders across the family (C(x) as a curve in the C plane), the general solution as the family shifted by y_p with the difference of two solutions, and the initial value. Working with numbers; examples y′ + y = x, y′ − 2xy = x, y′ + y/x = x², cooling, RC circuit; game "Build the solution".
With explain mode: an AI tutor walks you through the app, points out what matters in the scene and answers your questions.
The method
A linear first-order differential equation has the form y′ + p(x)·y = q(x). First you solve the homogeneous equation y′ = −p(x)·y by separation of variables and get the family y_h = C·e^(−P(x)), where P is an antiderivative of p. In variation of constants, C is replaced by a function C(x). On substitution every term containing C(x) cancels, leaving C′(x) = q(x)·e^(P(x)). Integrating gives a particular solution y_p and the general solution y = y_p + C·y_h. An initial value fixes C.
What the app shows
Two cards sit side by side. On the left you see the direction field, the homogeneous family, the particular solution and the chosen solution. On the right is the C plane with C = y·e^(P(x)): there every homogeneous solution is a horizontal line and y_p becomes the curve C(x). A runner moves along y_p and shows that y_p lies at every point on the homogeneous curve with constant C(x). In step 3 the homogeneous family is shifted by y_p, and two solutions differ by a homogeneous solution. The working with numbers is shown alongside.
Try it yourself
Pick one of five examples: y′ + y = x, y′ − 2xy = x, y′ + y/x = x² for x > 0, Newton’s cooling of a coffee and an RC circuit driven by an alternating voltage. In step 2 drag the runner and compare C(x) in both cards. In step 4 set the initial point and read off C. In the game "Build the solution" you first guess whether the solution lies above or below y_p, then drag the start value until the solution passes exactly through a target.
Frequently asked questions
- How does variation of constants work?
- You set y = C(x)·y_h, where y_h solves the homogeneous equation. The product rule gives C′·y_h + C·(y_h′ + p·y_h) = q. The bracket is zero, so C′(x) = q(x)/y_h(x) = q(x)·e^(P(x)). Integrating gives C(x) and hence the solution.
- Why is the general solution y_p plus a homogeneous solution?
- If y₁ and y₂ solve y′ + p·y = q, their difference d = y₁ − y₂ satisfies d′ + p·d = 0. So every solution is one fixed particular solution plus a solution of the homogeneous equation. Which particular solution you pick does not matter.
- How do you solve y′ + y = x?
- Homogeneous: y_h = C·e^(−x). Variation: C′(x)·e^(−x) = x, so C′(x) = x·e^x and, integrating by parts, C(x) = (x − 1)·e^x. Hence y_p = x − 1 and y = x − 1 + C·e^(−x). With y(0) = 1 you get C = 2.
- What does the C plane in the app show?
- It plots C = y·e^(P(x)) against x. Homogeneous solutions are horizontal lines there, the particular solution is the curve C(x), and all solutions of the full equation are vertically shifted copies of it. The factor e^(P(x)) is also the integrating factor.
Subject: Differential equations
More from Differential equations
- Homogeneous ODEs y′ = F(y/x)
- Initial value problem: dropping a ball
- ODE: the line-up
- Linear substitution
- Direction field y'(x) = -x/y
- Separation of variables
- Worlds of differential equations
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps