Differential Equation Solver | ODE Calculator with Steps
📐 Differential Equations | ODE Solver

Solve Differential Equation Calculator

Solve first-order ordinary differential equations (ODEs) step by step. Supports separable, linear, and basic first-order equations.

Type dy/dx = f(x)g(y)
Standard Form dy/dx + P(x)y = Q(x)
Solution General + Particular
📐 Differential Equation Solver First-Order ODE
📋 Solution
Solution y(x) =
Step-by-step solution will appear here.

How to Solve Differential Equations: A Complete Guide

A differential equation is an equation that relates a function to its derivatives. Differential equations are fundamental in physics, engineering, biology, economics, and many other fields because they describe how quantities change over time or space. This solver handles first-order ordinary differential equations (ODEs) — equations involving the first derivative dy/dx.

Key Insight: The order of a differential equation is the highest derivative present. First-order ODEs involve only dy/dx and are the building blocks for understanding more complex systems.

Types of First-Order Differential Equations

Separable Equations: A first-order ODE is separable if it can be written in the form dy/dx = f(x)g(y). These are solved by separating variables: dy/g(y) = f(x) dx, then integrating both sides.

Separable Form: dy/dx = f(x)·g(y)
Solution Method: ∫ dy/g(y) = ∫ f(x) dx + C

Linear First-Order Equations: A first-order ODE is linear if it can be written in the form dy/dx + P(x)y = Q(x). These are solved using an integrating factor μ(x) = e^∫P(x)dx.

Linear Form: dy/dx + P(x)y = Q(x)
Integrating Factor: μ(x) = e^∫P(x)dx
Solution: y·μ(x) = ∫ μ(x)Q(x) dx + C

Step-by-Step Examples

📌 Example 1: Separable Equation dy/dx = x²·y

Step 1: Separate variables: dy/y = x² dx
Step 2: Integrate both sides: ∫ dy/y = ∫ x² dx → ln|y| = x³/3 + C
Step 3: Solve for y: y = C·e^(x³/3)
Answer: y(x) = C·e^(x³/3)

📌 Example 2: Separable with Initial Condition dy/dx = 2xy, y(0)=3

Step 1: Separate: dy/y = 2x dx
Step 2: Integrate: ln|y| = x² + C → y = C·e^(x²)
Step 3: Apply y(0)=3: 3 = C·e^0 → C = 3
Answer: y(x) = 3e^(x²)

📌 Example 3: Linear Equation dy/dx + 2xy = x

Step 1: Identify P(x)=2x, Q(x)=x
Step 2: Integrating factor μ = e^∫2x dx = e^(x²)
Step 3: Multiply: e^(x²)·dy/dx + 2x e^(x²)y = x e^(x²)
Step 4: Left side is d/dx[y·e^(x²)] = x e^(x²)
Step 5: Integrate: y·e^(x²) = ∫ x e^(x²) dx = (1/2)e^(x²) + C
Answer: y = 1/2 + C·e^(-x²)

📌 Example 4: Linear with IC dy/dx + (1/x)y = x, y(1)=2

Step 1: μ = e^∫(1/x)dx = e^(ln|x|) = x
Step 2: Multiply: x·dy/dx + y = x² → d/dx(x·y) = x²
Step 3: Integrate: x·y = ∫ x² dx = x³/3 + C
Step 4: y = x²/3 + C/x
Step 5: Apply y(1)=2: 2 = 1/3 + C → C = 5/3
Answer: y(x) = x²/3 + 5/(3x)

📌 Example 5: Separable dy/dx = (x+1)/(y²)

Step 1: Separate: y² dy = (x+1) dx
Step 2: Integrate: ∫ y² dy = ∫ (x+1) dx → y³/3 = x²/2 + x + C
Answer: y = ∛(3x²/2 + 3x + 3C)

Applications of Differential Equations

Population Growth (Malthusian Model): dP/dt = kP describes exponential population growth. The solution P(t) = P₀e^(kt) is used in biology and ecology.

Newton’s Law of Cooling: dT/dt = -k(T – Tₐ) describes how an object’s temperature approaches ambient temperature. Used in forensic science to estimate time of death and in engineering for thermal management.

Radioactive Decay: dN/dt = -λN models decay of radioactive isotopes. Used in carbon dating, nuclear physics, and medical imaging (PET scans).

RC Circuits: dV/dt + (1/RC)V = V₀/RC describes voltage across a capacitor in an RC circuit. Foundational in electrical engineering.

Logistic Growth: dP/dt = rP(1 – P/K) models population with carrying capacity. Used in ecology, epidemiology, and resource management.

How to Use This Differential Equation Solver

  • Step 1: Select the equation type — Separable or Linear first-order ODE.
  • Step 2: Enter the functions f(x) and g(y) for separable equations, or P(x) and Q(x) for linear equations.
  • Step 3: Enter an initial condition y(x₀)=y₀ if you want a particular solution (leave blank for general solution).
  • Step 4: Click “Solve Differential Equation” to see the step-by-step solution.
  • Step 5: Review the detailed steps and final solution.
📝 Mathematical Notation Tips: Use “^” for exponents (x^2, e^(3x)). Use sin(x), cos(x), tan(x), ln(x), e^x. Multiplication is implicit: “2x” means 2·x. Parentheses are important: e^(2x) not e^2x.

Common Mistakes to Avoid

  • Forgetting the constant of integration: Always add +C when integrating indefinite integrals. The constant is essential for the general solution.
  • Not separating variables correctly: Make sure all y terms are on one side and all x terms on the other before integrating.
  • Misidentifying equation type: Not every first-order ODE is separable or linear. Our calculator handles these two major types.
  • Incorrect integrating factor: For linear equations, μ = e^∫P(x)dx. Don’t forget the exponential.
  • Sign errors: Pay attention to negative signs, especially when isolating derivatives.

Existence and Uniqueness Theorem

The Existence and Uniqueness Theorem guarantees that an initial value problem dy/dx = f(x,y), y(x₀)=y₀ has a unique solution if f and ∂f/∂y are continuous in a region around (x₀, y₀). This theorem is fundamental because it tells us when a differential equation solution is well-defined and predictable. For linear equations dy/dx + P(x)y = Q(x), if P and Q are continuous on an interval, a unique solution exists for any initial condition in that interval.

Numerical Methods for ODEs

When analytical solutions are impossible (most real-world differential equations), numerical methods are used. Common methods include:

  • Euler’s Method: The simplest numerical method. Approximates y using the tangent line: y_{n+1} = y_n + h·f(x_n, y_n).
  • Runge-Kutta Methods (RK4): More accurate than Euler. RK4 is the standard for many scientific computing applications.
  • Adams-Bashforth: Multi-step method using previous values for higher accuracy.

Numerical methods are essential in engineering simulations, weather forecasting, and computational fluid dynamics where analytical solutions don’t exist.

Higher-Order Differential Equations

Second-order and higher ODEs are common in physics (Newton’s second law F=ma gives second-order ODEs). They can often be reduced to systems of first-order ODEs. The characteristic equation method solves linear constant-coefficient ODEs: ay” + by’ + cy = 0 leads to the auxiliary equation ar² + br + c = 0.

While this solver focuses on first-order ODEs, understanding these basics prepares you for more advanced study in differential equations, including Laplace transforms, series solutions, and partial differential equations.

Frequently Asked Questions

© 2025 Differential Equation Solver — Learn to solve ODEs step by step. For educational purposes.

Leave a Comment

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

Scroll to Top