function slide=symcalcdemo
% This is a slideshow file for use with playshow.m and makeshow.m
% Too see it run, type 'playshow symcalcdemo', 

% Copyright (c) 1993-1999 The Mathworks, Inc. All Rights Reserved.
% $Revision: 1.4 $
if nargout<1,
  playshow symcalcdemo
else
  %========== Slide 1 ==========

  slide(1).code={
   '' };
  slide(1).text={
   'Demonstate the Symbolic Math Toolbox with a simple calculus example.'};

  %========== Slide 2 ==========

  slide(2).code={
   'syms x',
   'f = 1/(5+4*cos(x));',
   'ezplot(f)',
   '' };
  slide(2).text={
   'The statement',
   '    x = sym(''x'')',
   'creates a symbolic variable, x.',
   '',
   'The statements',
   '    f = 1/(5 + 4*cos(x))',
   '    ezplot(f)',
   'define and plot a function of x.'};

  %========== Slide 3 ==========

  slide(3).code={
   'f1 = diff(f);',
   'ezplot(f1);',
   '' };
  slide(3).text={
   'The statements',
   '',
   '    f1 = diff(f)',
   '    ezplot(f1)',
   '',
   'differentiate the function once and plot the result'};

  %========== Slide 4 ==========

  slide(4).code={
   'f2 = diff(f,2);',
   'ezplot(f2)' };
  slide(4).text={
   'The statements',
   '',
   '    f2 = diff(f,2)',
   '    ezplot(f2)',
   '',
   'differentiate the function twice and plot the result.'};

  %========== Slide 5 ==========

  slide(5).code={
   'g = int(int(f2));',
   'ezplot(g)' };
  slide(5).text={
   'The statements',
   '',
   '    g = int(int(f2))',
   '    ezplot(g)',
   '',
   'try to retrieve the original function by integrating the second derivative twice.'};

  %========== Slide 6 ==========

  slide(6).code={
   'ezplot(f)' };
  slide(6).text={
   'Here is the original function again.  At first glance, the plots for f and g look the same.  But, look more carefully at the formula for f in the title of the graph and the range of f on the y-axis.  Then use the Prev and Next buttons to compare f and g.'};

  %========== Slide 7 ==========

  slide(7).code={
   'e = f - g;',
   'ezplot(e)' };
  slide(7).text={
   'The difference between f and g is',
   '',
   '    e = f - g',
   '    ezplot(e)',
   '',
   'The difference has a complicated formula, but its graph looks like a constant.'};

  %========== Slide 8 ==========

  slide(8).code={
   'e = simple(e);',
   'ezplot(e)' };
  slide(8).text={
   'The statements',
   '',
   '    e = simple(e)',
   '    ezplot(e)',
   '',
   'show that the difference really is a constant, resulting from differentiating twice and then integrating the result twice.',
   '',
   ''};
end
