	\chapter{Introduction}
\section{What this wiki is}

This wiki encapsulates the Math 104E calculus course at the University of Pennsylvania. 104E is a second semester calculus course presented for an engineering audience (hence the "E"). The goal of this wiki is to codify the content of this course in a way that is easily expandable or amendable as necessary, and to provide future teachers/students of the course with a lean, searchable text. The pages are in sequence (navigable from the home page or by using the arrows at the top and bottom of each page), and each page is designed to be a mini-lecture of about 10 -15 minutes.

\section{Prerequisites}
This course assumes that you have had a first semester calculus course (such as AP Calculus AB or Math 103 at Penn). You should be able to compute basic derivatives and integrals. Experience shows that some students may need to brush up on precalculus skills: factoring, exponent rules, logarithm rules, trigonometric functions and unit circle values, and graphing functions (among other things).

\section{Philosophy}
This course focuses on the big picture over gritty calculations and memorized tricks. There will be some things you simply must commit to memory, but these will be few and highlighted in some way (yet to be determined). Also, a certain amount of practice is required to gain facility in the basic mechanics of calculus. For that, you should look to the big fat calculus text sold in the bookstore (at least until we have enough problems built into the wiki).

\section{Outline}
These are the big topics covered, and the number of lectures per topic:
1. Functions: 9 lectures
2. Differentiation: 7 lectures
3. Integration: 12 lectures
4. Applications: 14 lectures
5. Discrete Calculus: 13 lectures


\newpage
\chapter{Functions}
1. Functions - Definition and examples of functions
2. The Exponential - The exponential function defined
3. Taylor series - The Taylor series defined and applied
4. Computing Taylor series - Using composition to compute Taylor series
5. Convergence - Problems with some Taylor series
6. Expansion points - Taylor series expansions about other points
7. Limits - Definition of limit and continuity
8. L'Hopital's Rule - Statement and examples in a Taylor series context
9. Orders of growth - Relative growth of the most common functions



A function can be visualized as a machine that takes in an input $x$ and returns an output $f(x)$. The collection of all possible inputs is called the domain, and the collection of all possible outputs is called the range.


This course deals with functions whose domains and ranges are $\mathbb{R}$ or subsets of $\mathbb{R}$ (this is the notation for the real numbers).

\section{Definition and examples of functions}
\begin{enumerate}
	\item Polynomials, e.g. $f(x)=x^3-5 x^2+x+9$. Give the domain and range of $f$. \hyperref[FunctionsAnswer1]{Answer}
	\item Trigonometric functions, e.g. sin, cos, tan. Give the domain and range for each of these. \hyperref[FunctionsAnswer2]{Answer}
	\item The exponential function, $e^x$. Give the domain and range for the exponential. \hyperref[FunctionsAnswer3]{Answer}
	\item The natural logarithm function, $\ln x$. Recall that this is the inverse of the exponential function. Give the domain and range for $\ln x$. \hyperref[FunctionsAnswer4]{Answer}
	\item Is $\sin ^{-1}$ a function? If so, why? If not, is there a way to make it into a function?  \hyperref[FunctionsAnswer5]{Answer}
\end{enumerate}




\section{Operations on Functions}
\subsection{COMPOSITION}
The composition of two functions, $f$ and $g$, is defined to be the function that takes as its input $\mathrm{x}$ and returns as its output $g(x)$ fed into $f$.
$$
f \circ g(x)=f(g(x))
$$

\subsection*{Example:}
$\sqrt{1-x^2}$ can be thought of as the composition of two functions, $f$ and $g$. If $g=1-x^2, f$ would be the function that takes an input $g(x)$ and returns its square root.


\subsection*{Example:}
Compute the composition $f \circ f$, i.e. the composition of $f$ with itself, where $f(x)=\frac{1}{x+1}$. \hyperref[FunctionsAnswer6]{Answer}

\subsection{INVERSE}

The inverse is the function that undoes $f$. If you plug $f(x)$ into $f^{-1}$, you will get $x$. Notice that this function works both ways. If you plug $f^{-1}(x)$ into $f(x)$, you will get back $x$ again.
$$
\begin{aligned}
	& f^{-1}(f(x))=x \\
	& f\left(f^{-1}(x)\right)=x
\end{aligned}
$$

NOTE: $f^{-1}$ denotes the inverse, not the reciprocal. $f^{-1}(x) \neq \frac{1}{f(x)}$.
Example:
Let's consider $f(x)=x^3$. Its inverse is $f^{-1}(x)=x^{\frac{1}{3}}$.
$$
\begin{aligned}
	& f^{-1}(f(x))=\left(x^3\right)^{\frac{1}{3}}=x \\
	& f\left(f^{-1}(x)\right)=\left(x^{\frac{1}{3}}\right)^3=x
\end{aligned}
$$

Notice that the graphs of $f$ and $f^{-1}$ are always going to be symmetric about the line $y=x$. That is the line where the input and the output are the same:


\section{Classes of Functions}
\subsection{POLYNOMIALS}
A polynomial $P(x)$ is a function of the form
$$
P(x)=c_0+c_1 x+c_2 x^2+\cdots+c_n x^n
$$

The top power $n$ is called the degree of the polynomial. We can also write a polynomial using a summation notation.
$$
P(x)=\sum_{k=0}^n c_k x^k
$$

\subsection{RATIONAL FUNCTIONS}
Rational functions are functions of the form $\frac{P(x)}{Q(x)}$ where each is a polynomial.

\textbf{Example:}
$3 x-1$ $\qquad$ $\overline{x^2+x-6}$ is a rational function. You have to be careful of the denominator. When the denominator takes a value of zero, the function may not be well-defined.

\subsection{POWERS}
Power functions are functions of the form $c x^n$, where $c$ and $n$ are constant real numbers.
Other powers besides those of positive integers are useful.

\subsubsection*{Example:}
\begin{itemize}
	\item 	What is $x^0$ ? \hyperref[FunctionsAnswer7]{Answer}
	\item 	What is $x^{-\frac{1}{2}}$ ? \hyperref[FunctionsAnswer8]{Answer}
	\item 	What is $x^{\frac{22}{7}}$ ? \hyperref[FunctionsAnswer9]{Answer}
	\item 	What is $x^\pi$ ? We are not yet equipped to handle this, but we will come back to it later.
	
\end{itemize}

\subsection{TRIGONOMETRICS}

You should be familiar with the basic trigonometric functions $\sin$, cos. One fact to keep in mind is $\cos ^2 \theta+\sin ^2 \theta=1$ for any $\theta$. This is known as a Pythagorean identity, which is so named because of one of the ways to prove it:

\begin{figure}[h]
	\centering
	\includegraphics[width=0.5\linewidth]{Upenn001}
	%		\caption{}
	\label{fig:upenn001}
\end{figure}

By looking at a right triangle with hypotenuse 1 and angle $\theta$, and labeling the adjacent and opposite sides accordingly, one finds by using Pythagoras' Theorem that $\cos ^2 \theta+\sin ^2 \theta=1$.

Another way to think about it is to embed the above triangle into a diagram for the unit circle where we see that $\cos \theta$ and $\sin \theta$ returns the $\mathrm{x}$ and $\mathrm{y}$ coordinates, respectively, of a point on the unit circle with angle $\theta$ to the $x$-axis:

\begin{figure}[h]
	\centering
	\includegraphics[width=0.5\linewidth]{Upenn002}
	%		\caption{}
	\label{fig:upenn002}
\end{figure}

That explains the nature of the formula $\cos ^2 \theta+\sin ^2 \theta=1$. It comes from the equation of the unit circle $x^2+y^2=1$.

Others trigonometric functions:
\begin{itemize}
	\item $\tan =\frac{\sin }{\cos }$
	\item $\cot =\frac{\cos }{\sin }$, the reciprocal of $\tan$
	\item $\sec =\frac{1}{\cos }$, the reciprocal of the $\cos$
	\item $\csc =\frac{1}{\sin }$, the reciprocal of the $\sin$
\end{itemize}

All four of these have vertical asymptotes at the points where the denominator goes to zero.

\subsection{INVERSE TRIGONOMETRICS}
We often write $\sin ^{-1}$ to denote the inverse, but this can cause confusion. Be careful that $\sin ^{-1} \neq \frac{1}{\sin }$. To avoid the confusion, the terminology arcsin is recommended for the inverse of the sin function.

The arccos function likewise has a restricted domain $[-1,1]$, but it takes values $[0, \pi]$.
The arctan function has an unbounded domain, it is well defined for all inputs. But it has a restricted range $\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$.
\subsection{EXPONENTIALS}
Exponential functions are of the form $c^x$, where $c$ is some positive constant. The most common such function, referred to as the exponential, is $e^x$. This is the most common because of its nice integral and differential properties (below).

Algebraic properties of the exponential function:
$$
\begin{gathered}
	e^x e^y=e^{x+y} \\
	\left(e^x\right)^y=e^{x y}
\end{gathered}
$$

Differential/integral properties:
$$
\begin{gathered}
	\frac{d}{d x} e^x=e^x \\
	\int e^x d x=e^x+C
\end{gathered}
$$

Recall the graph of $e^x$, plotted here alongside its inverse, $\ln x$ :

\begin{figure}[h]
	\centering
	\includegraphics[width=0.5\linewidth]{Upenn003}
	%		\caption{}
	\label{fig:upenn003}
\end{figure}


Note that the graphs are symmetric about the line $y=x$ (as is true of the graphs of a function and its inverse).

Before continuing, one might ask, what is $\epsilon$ ? There are several ways to define $\epsilon$, which will be revealed soon. For now, it is an irrational number which is approximately $2.718281828$ .

\subsection{Euler's Formula}

To close this lesson, we give a wonderful formula, which for now we will just take as a fact:


\begin{minipage}[t]{\textwidth}
\vspace{2mm}
\noindent\begin{tcolorbox}[colback=blue!25!white,colframe=blue!75!black]
	Euler's Formula
	\begin{tcolorbox}[colback=blue!5!white,colframe=blue!75!black]
		$$
		e^{i x}=\cos x+i \sin x
		$$
	\end{tcolorbox}
\end{tcolorbox}
\vspace{2mm}
\end{minipage}

The $i$ in the exponent is the imaginary number $\sqrt{-1}$. It has the properties $i^2=-1 \cdot i$ is not a real number. That doesn't mean that it doesn't exist. It just means it is not on a real number line.

Euler's formula concerns the exponentiation of an imaginary variable. What exactly does that mean? How is this related to trigonometric functions? This will be covered in our next lesson.

The $i$ in the exponent is the imaginary number $\sqrt{-1}$. It has the properties $i^2=-1 \cdot i$ is not a real number.

That doesn't mean that it doesn't exist. It just means it is not on a real number line.

Euler's formula concerns the exponentiation of an imaginary variable. What exactly does that mean? How is this related to trigonometric functions? This will be covered in our next lesson.

\subsection{Additional Examples}

\subsubsection*{Example}
Find the domain of
$$
f(x)=\frac{1}{\sqrt{x^2-3 x+2}} .
$$

\hyperref[FunctionsAnswer10]{Answer}

\subsubsection*{Example}
Find the domain of
$$
f(x)=\ln \left(x^3-6 x^2+8 x\right) .
$$

\hyperref[FunctionsAnswer11]{Answer}