%Defining, Evaluationg and Plotting Functions
%If you modify this file, please indicate here and in the footnote.
%Math263A
\documentclass[12pt]{article}
\usepackage{times}
\pagestyle{empty}
\topmargin -.2in
\headheight 0in
\addtolength{\textwidth}{1.2in}
\addtolength{\textheight}{1.2in}
\addtolength{\oddsidemargin}{-.58in}
\addtolength{\evensidemargin}{-.58in}
\renewcommand{\baselinestretch}{1.0}
\parindent = 0cm
\parskip = .1cm
\begin{document}
\begin{center}
\Large
Defining, Evaluating and Plotting Functions\footnote{
Copyright \copyright 2002, Larry Snyder and Todd Young.
All rights reserved. Please address comments to young@math.ohiou.edu.}
\end{center}
\begin{enumerate}
\item At the prompt type:
\verb& syms x & and then press \fbox{Enter}.\\
Now type \verb& f = sin(x) & and then press \fbox{Enter}.
\item Type (at the prompt and then press \fbox{Enter}):\\
\verb& subs(f, 2)& \\
\verb& subs(f, '2') &\\
\verb& double(ans) &\\
Which of the above answers are numerical and which are
symbolic? (You may want to type: \verb& help subs & and
\verb& help double & for explanations)
\item Enter: \verb& ezplot(f)&
\item Following the example above, define and plot the
function \textsf{g(x) = exp(x)} by typing:\\
\verb$ syms x$ \\
\verb$ g = exp(x)$ \\
\verb$ ezplot(g)$ \\
Then adjust the domain in the plot by typing:
\verb& ezplot(g,[-2,2])&
\item Enter: \verb& ezplot(x^2) &
\item Plot the function
$\sqrt{\textsf{x$^{\textsf{\begin{scriptsize}2\end{scriptsize}}}$ - .00001}}$
by typing: \verb$ ezplot(sqrt(x^2 - .00001))$.
\\Plot the function
\textsf{x$^{\textsf{\begin{scriptsize}7\end{scriptsize}}}$ - x}
by typing: \verb& ezplot(x^7 - x)&.
\\Because of the domain chosen by the computer, important features
of the graphs are missing. What are they? Try adjusting the
domains until these features are shown.
\item Plot the function
\textsf{sin(x$^\textsf{\begin{scriptsize}5\end{scriptsize}}$)}
by typing: \verb$ ezplot(sin(x^5))$.
A computer plots a function by locating a finite number of points
and ``connecting the dots". How does this go wrong for
\textsf{sin(x$^\textsf{\begin{scriptsize}5\end{scriptsize}}$)}?
\item Prepare a brief (\verb$< $2 page) written report describing what
happened, answering all the questions and sketching the plots.
Use complete sentences and standard mathematical notation.
Do {\bf not} get a printout.
\end{enumerate}
\vfill
\noindent
\textsf{These exercises introduce basic commands for defining and plotting
functions. They consider the difference between
numerical and symbolic evaluation of a function and
the processes by which the software makes plots. They address
issues of scale and the effects of rapid oscillation on plotting.}
\end{document}