# Symbolic Mathematics

Introduction

1. MATLAB’s symbolic capability is based on the MuPad software, originally produced by SciFace Software.
2. SciFace was purchased by the Mathworks in2008.
3. The MuPad engine is part of the symbolic toolbox.
4. A MuPad notebook is created by typing mupad at command prompt.

Creating Symbolic Variables

1. Symbolic mathematics is used regularly in math, engineering, and science classes.
2. It is often preferable to manipulate equations symbolically before substituting values for variables.
3. Before solving any equation(s), there is a need to create some symbolic variables.
4. Simple symbolic variables can be created in two ways.
5. To create the symbolic variable x, type either
x = sym (‘x’)
Or
syms x
Both techniques set the character ‘x’ equal to the symbolic variable x .

6. Note that in the workspace window both x and y are listed as symbolic variables and the array size for each is 1 x 1.
7. The syms command is particularly convenient, because it can be used to create multiple symbolic variables at the same time.
8. The sym function can also be used to create either an entire expression or an entire equation.

Symbolic Plotting

1. The Ezplot function: The symbolic toolbox includes a group of functions that allow you to plot symbolic functions. The most basic is ezplot.

2. Other plots: The 3D surface plotting functions (ezmesh, ezmeshc, ezsurf, and ezsurfc) are used that mirror the functions used in numeric plotting options.

Differentiation

A function called diff is used to find the derivative of a symbolic expression.

Integration

A function called int is used to find the integral of a symbolic expression.

Differential Equation

1. Differential equations contain both the dependent variable and its derivative with respect to the independent variable.
2. The symbolic toolbox includes a function called dsolve that solves differential equations, that is, it solves for y in terms of t.

Convert Expressions to Functions

The matlabFunction function converts a symbolic expression into an anonymous function.