Main Content

# Equation Solving

Solve algebraic and differential equations

You can solve algebraic equations, differential equations, and differential algebraic equations (DAEs).

Solve algebraic equations to get either exact analytic solutions or high-precision numeric solutions. For analytic solutions, use `solve`, and for numerical solutions, use `vpasolve`. For solving linear equations, use `linsolve`. These solver functions have the flexibility to handle complicated problems. See Troubleshoot Equation Solutions from solve Function.

Solve differential equations by using `dsolve`. Create these differential equations by using symbolic functions. See Create Symbolic Functions.

Solve differential algebraic equations (DAEs) by first reducing their differential index to `1` or `0` using Symbolic Math Toolbox™ functions, and then using MATLAB® solvers, such as `ode15i`, `ode15s`, or `ode23t`. See Solve Differential Algebraic Equations (DAEs).

## Live Editor Tasks

 Solve Symbolic Equation Find analytic solutions of symbolic equations in Live Editor (Since R2020a)

## Functions

expand all

 `equationsToMatrix` Convert linear equations to matrix form `eliminate` Eliminate variables from rational equations `finverse` Functional inverse `isolate` Isolate variable or expression in equation `linsolve` Solve symbolic linear equations in matrix form `poles` Poles of expression or function `solve` Equations and systems solver `vpasolve` Solve symbolic equations numerically
 `dsolve` Solve system of differential equations `massMatrixForm` Extract mass matrix and right side of semilinear system of differential algebraic equations `odeFunction` Convert symbolic expressions to function handle for ODE solvers `odeToVectorField` Reduce order of differential equations to first-order
 `daeFunction` Convert system of differential algebraic equations to MATLAB function handle suitable for `ode15i` `decic` Find consistent initial conditions for first-order implicit ODE system with algebraic constraints `findDecoupledBlocks` Search for decoupled blocks in systems of equations `incidenceMatrix` Find incidence matrix of system of equations `isLowIndexDAE` Check if differential index of system of equations is lower than 2 `massMatrixForm` Extract mass matrix and right side of semilinear system of differential algebraic equations `odeFunction` Convert symbolic expressions to function handle for ODE solvers `reduceDAEIndex` Convert system of first-order differential algebraic equations to equivalent system of differential index 1 `reduceDAEToODE` Convert system of first-order semilinear differential algebraic equations to equivalent system of differential index 0 `reduceDifferentialOrder` Reduce system of higher-order differential equations to equivalent system of first-order differential equations `reduceRedundancies` Simplify system of first-order differential algebraic equations by eliminating redundant equations and variables
 `pdeCoefficients` Extract coefficients of partial differential equation (Since R2021a) `pdeCoefficientsToDouble` Convert symbolic PDE coefficients to `double` format (Since R2021a)