%Symbolic toolkit example
clear
%Define a symbolic variable x
syms x
%Define a symbolic expression
expr = x^2 + 3*x + 2;
%evaluate the expression with x = 7
evaluated_expr = subs(expr, x, 7)
%A ratio of symbolic expressions
frac = expr/(x+1)
%Simplified form
simplified_form = simplify(frac)
%Define equations for two curves
f = x^2 - 9;
g = 3*x + 2;
%plot two curves
clf;
ezplot(f);
hold on
ezplot(g);
%find the points of intersection
bounds = solve(f == g)
%compute the area between two curves
area = int(f - g, x, bounds(1), bounds(2))
%display the result as a floating-point a.k.a. decimal 
area = double(area)


