clc
clear all
disp('Calculus Operations')
disp(' ')
%% Chapter 13
disp('       Part 1 - Derivative and Subsitution Commands')
disp('Exercise 1 - Chapter 13')
% INPUTS
disp('INPUTS')
syms x                       % x is symbolic
eqn1 =4*sin(4*x^2)+exp(x);   % enter desired equation
eqn1d=char(eqn1);            % convert the eqn to a string
fprintf('  y = %s\n\n',eqn1d)
% CODE - for diff
disp('OUTPUTS')
dydx =diff(eqn1,x,2);        % derivative of the function
dydx2=char(dydx);            % converted to string
fprintf('  d2y/dx2 = %s\n',dydx2)
% CODE - for subs
xnew =3.75;                  % plug this value in        
seqn =subs(dydx2,x,xnew);    % subs command being used
fprintf('  d2y/dx2 @ %g = %g\n\n',xnew,seqn)
