clear
format compact
echo on

f = 'x^3 + a * log( y ) + b - x'
pause

df_x = diff( f, 'x' )
pause

df_y = diff( f, 'y' )
pause

fs = sym( 'x^3 + a * log( y ) + b - x' )
pause

syms x y a b
f = x^3 + a * log( y ) + b - x
pause

clear
syms x y a
f = a * x * (y + a)
pause

g = subs( f, a, 3 )
pause

clear
f = sym('a * x * (y + a)')
pause

x = 5;
y = 'z';

subs(f)
pause

clear
syms x b

f = sym( 'x^2 + 2 * x * y + y^2' )
pause

g = subs( f, {x, 'y'}, {'a', b} )
pause

xx = -1:0.1:1;
[mx, my] = meshgrid( xx );
pause

mz = subs( g, {'a', b}, {mx, my} );
mesh( mx, my, double( mz ) )
hold on
pause

yy = cos( xx );
zz = subs( g, {'a', b}, {xx, yy} );
pause

plot3( xx, yy, double( zz ) )
pause

view(2)
pause

clear
f = sym( 'cos(x)^2 + sin(x)^2' )
pause

pretty( f )
pause

[r, how] = simple( f )
pause
