%% Using the Symbolic Math Toolbox
%% Solving an Equation using Symbolic Tools
%
% Calculate the roots of the equation  using symbolic math.


clear all
% Define symbolic variable.
syms a b c x
% Solve equation.
solve(a*x*x+b*x+c)

%
%% Indefinite Integral
%

syms x
int(sin(x))

%

int(1/(1+(6*x-1)^2))

%

int(exp(x)*sin(x)^2)

%

int(1/(1+sin(3*x)^2))

%

int(4/(sqrt(3*x*x+10*x+9)))

%
%% Definite Integral
%
%

syms x
int(sin(x),0,1)
double(int(sin(x),0,1))

%

double(int(sin(x)^2,0,pi))

%

double(int(sin(log(x)),1,2))

%

double(int(1/sqrt((4*x-1)^2+11),0,3))

%
%% Derivative of a Function
%

syms x
diff(sin(x))