lhs

Left side of an equation.

Category: Mathematics > Formula Manipulation and Simplification

Syntax

L = lhs(eq)

Returns the left-hand side of eq, element by element for an array of equations.

Description

Equations are built with ==, for example x^2 == 4*x + 1. lhs and rhs take them apart, which helps when post-processing the result of solve or when moving everything to one side with lhs(eq) - rhs(eq).

Input arguments

eq
Symbolic equation or array of equations.

Output arguments

L
Symbolic expression or array.

Example

Both sides of an equation

syms x
eq = x^2 == 4*x + 1;
lhs(eq)
rhs(eq)
Output
ans = x^2
ans = 4*x + 1

See also

rhs isolate solve isequal