$$\begin{align}
&\text{Eric Nguyen} &\qquad \text{January 16, 2019} \\
&\textbf{Calculus Ch. 1 Study Guide} \\
&\textbf{Directions: } \text{Please complete each of the following problems to the best of your ability.} \\
&\text{If you have a question, I will do my best to answer them.} \\
&\text{Work honestly and with integrity, and always } \textbf{DO YOUR BEST WORK.} \\\\
\end{align}$$


```python
%matplotlib inline
%config InlineBackend.figure_format='retina'
from numpy import e, power, log, exp, linspace
from matplotlib.pyplot import plot
```

$\text{Differentiate.}$

$1)$
$$\begin{align} \\
y &= xe^{-2x} + e^{-x} + x^3 \\
y' &= -2xe^{-2x} + e^{-2x} - e^{-x} + 3x^2 \\
&= -xe^{-2x} - e^{-x} + 3x^2
\end{align}$$


```python
y = lambda x: x * exp(-2 * x) + exp(-x) + power(x, 3)
dy = lambda x: -x * exp(-2 * x) - exp(-x) + 3 * power(x, 2)
x = linspace(0, 10, 100)
plot(x, y(x))
_ = plot(x, dy(x))
```

$2)$
$$\begin{align}
f(t) &= \ln{\frac{1 - t}{1 + t}} \\
&= \ln{(1 - t)} - \ln{(1 + t)} \\
f'(t) &= -\frac{1}{1 - t} - \frac{1}{1 + t}
\end{align}$$


```python
f = lambda t: log((1 - t) / (1 + t))
my_df = lambda t: -(1 / (1 - t)) - (1 / (1 + t))
x = linspace(-0.9, 0.9, 1000)
plot(x, f(x))
_ = plot(x, my_df(x))
```

$3)$
$$\begin{align}
y &= 7^{x^4+2} \\
y' &= \ln{7} \cdot 7^{x^4+2} \cdot 4x^3
\end{align}$$


```python
y = lambda x: power(7, power(x, 4) + 2)
dy = lambda x: log(7) * y(x) * 4 * power(x, 3)
x1 = linspace(1.8, 2, 100)
x2 = linspace(1.8, 1.93, 100)
plot(x1, y(x1))
_ = plot(x2, dy(x2))
```

$4)$
$$\begin{align}
y &= 6^x \cdot \log_7{x} \\
y' &= 6^x \cdot \frac{1}{\ln{7}} \cdot \frac{1}{x} + \log_7{x} \cdot \ln{6} \cdot 6^x \\
&= \frac{6^x}{x \cdot \ln{7}} + \log_7{x} \cdot \ln{6} \cdot 6^x
\end{align}$$


```python
log7 = lambda x: log(x) / log(7)
y = lambda x: power(6, x) * log7(x)
dy = lambda x: power(6, x) * (1 / log(7)) * (1 / x) + log7(x) * log(6) * power(6, x)
x = linspace(7, 10, 100)
plot(x, y(x))
_ = plot(x, dy(x))
```

$5)$
$$\begin{align}
y &= \ln{\left(\left(-\frac{4^{x^4}}{x^3-3}\right)^5\right)} \\
y' &= \frac{1}{u} \cdot u' \\
u &= \left(-\frac{4^{x^4}}{x^3-3}\right)^5 \\
v &= -\frac{4^{x^4}}{x^3-3} \\
v' &= -\frac{(x^3 - 3) \cdot (\ln{4} \cdot 4^{x^4} \cdot 4x^3) - (x^3 - 3) \cdot (3x^2)}{(x^3 - 3)^2} \\
&= -\frac{(\ln{4} \cdot 4^{x^4} \cdot 4x^3) - (3x^2)}{(x^3 - 3)} \\
u' &= 5v^4 \cdot v' \\
&= 5\left(-\frac{4^{x^4}}{x^3-3}\right)^4 \cdot -\frac{(\ln{4} \cdot 4^{x^4} \cdot 4x^3) - (3x^2)}{(x^3 - 3)} \\
y' &= \frac{1}{\left(-\frac{4^{x^4}}{x^3-3}\right)^5} \cdot 5\left(-\frac{4^{x^4}}{x^3-3}\right)^4 \cdot -\frac{(\ln{4} \cdot 4^{x^4} \cdot 4x^3) - (3x^2)}{(x^3 - 3)} \\
&=\frac{-5 \left((\ln{4} \cdot 4^{x^4} \cdot 4x^3) - (3x^2)\right)}{\left(-\frac{4^{x^4}}{x^3-3}\right)^5 \cdot (x^3 - 3)} \cdot \left(-\frac{4^{x^4}}{x^3-3}\right)^4 \\
\end{align}$$


```python
def v(x): 
    return -((power(4, power(x, 4))) / (power(x, 3) - 3))
def u(x):
    return power(v(x), 5)
def y(x):
    return log(u(x))
def dy(x):
    return ((-5 * ((log(4) * power(4, power(x, 4)) * 4 * power(x, 3)) - (3 * power(x, 2)))) / (u(x) * (power(x, 3) - 3))) * power(v(x), 4)
x = linspace(0, 1.4, 100)
plot(x, y(x))
_ = plot(x, dy(x))
```

$\text{6) Solve for } t.$
$$\begin{align} \\
P &= P_0e^{kt} \\
\frac{P}{P_0} &= e^{kt} \\
\ln{\frac{P}{P_0}} &= kt \\
t &= \frac{\ln{\frac{P}{P_0}}}{k}
\end{align}$$

$\text{7) Find the equation of the line tangent to the graph of } f(x) = e^{-x} \text{ at the point (0, 1)}$
$$\begin{align} \\
&& f'(x) &= -e^{-x} \\
&& f'(0) &= -e^{0} \\
&& &= -1 \\
&& y &= mx + b \\
&& y &= f'(0)(x - 0) + f(0) \\
&& y &= -x + 1
\end{align}$$


```python
f = lambda x: exp(-x)
tangent_line = lambda x: -x + 1
x = linspace(-2, 2, 100)
plot(x, f(x))
_ = plot(x, tangent_line(x))
```

$\text{8) Find the equation of the line tangent to the graph of } f(x) = e^{3x} \cdot \ln{(4x)} \text{ at } x = 1$
$$\begin{align} \\
f'(x) &= e^{3x} \cdot \frac{4}{4x} + \ln{4x} \cdot 3e^{3x} \\
&= e^{3x} \left(\frac{1}{x} + 3\ln{4x}\right) \\
f'(1) &= e^{3(1)} \left(\frac{1}{(1)} + 3\ln{4(1)}\right) \\
&= e^3 \left(1 + 3 \ln{4}\right) \\
y &= f'(1)(x - 1) + f(1) \\
&= e^3 \left(1 + 3 \ln{4}\right)(x - 1) + e^3 \cdot \ln{4}
\end{align}$$


```python
f = lambda x: exp(3 * x) * log(4 * x)
def df(x):
    return exp(3 * x) * ((1 / x) + 3 * log(4 * x))
tangent_line = lambda x: df(1) * (x - 1) + f(1)
x = linspace(0.5, 1.5, 100)
plot(x, f(x))
_ = plot(x, tangent_line(x))
```

$\text{9) At a price of x dollars, the demand, in thousands of units, for a certain MP3 player is given by the demand function } q = 240e^{-0.003x}.$  
$\text{a) How many MP3 players will be bought at a price of \$250? Round to the nearest thousand.}$  
$\text{b) Find the marginal demand } q'(x).$  
$\text{c) Interpret the meaning of the derivative.}$


```python
q = lambda x: 240 * exp(-0.003 * x)
```


```python
q(250)
```




    113.36797265784352



$\text{9a) Approximately 113 MP3 players will be bought at a price of \$250.}$

$\text{9b)}$

$$\begin{align}
q'(x) &= -0.003 \cdot 240e^{-0.003x} \\
&= -0.72e^{-0.003x}
\end{align}$$


```python
dq = lambda x: -0.72 * exp(-0.003 * x)
x = linspace(-1000, 750, 1000)
plot(x, q(x))
_ = plot(x, dq(x))
```

$\text{9c) The derivative shows how the number of MP3 players sold changes slowly as the price increases.}$

$\text{10) Since 2000, sales of bottled water have increased at the rate of approximately 9.3% per year.}$  
$\text{That is, the volume of bottled water sold, } G \text{, in billions of gallons, } t \text{ years after 2000 is growing at a rate given by}$  
$$\frac{dG}{dt} = 0.093G.$$
$\text{a) Find the function that satisfies the equation, given that approximately 4.7 billion gallons of bottled water were sold in 2000.}$  
$\text{b) Predict the number of gallons of water that will be sold in 2010.}$  
$\text{c) What is the doubling time for } G(t)?$

$\text{a) } G(t) = 4.7 * 10^9e^{0.093t}$

$\text{b) } G(10) = 4.7 * 10^9e^{0.093(10)}$


```python
4.7 * power(10, 9) * exp(0.093 * 10)
```




    11912193134.803917



$\approx 12 \text{ billion}$

$\text{c) } \dfrac{\ln{2}}{0.093}$


```python
log(2) / 0.093
```




    7.453195489891885



$\approx 7.45 \text{ years}$

$\text{11) Iodine-131 has a decay rate of 9.6% per day. The rate of change of an amount N of iodine-131 is given by}$
$$\frac{dN}{dt} = -0.096N.$$
$\text{a) Let } N_0 \text{ represent the amount of iodine-131 present at } t = 0. \text{ Find the exponential function that models the situation.}$  
$\text{b) Suppose that 500g of iodine-131 is present at } t = 0. \text{ How much will remain after 4 days?}$  
$\text{c) After how many days will half of the 500g iodine-131 will remain?}$

$\text{a) } N(t) = N_0e^{-0.096t}$

$\text{b) } N(4) = 500e^{-0.096(4)}$


```python
500 * exp(-0.096 * 4)
```




    340.56571358977357



$\approx 340.566 \text{g}$

$\text{c) } \dfrac{\ln{2}}{0.096}$


```python
log(2) / 0.096
```




    7.2202831308327635



$\approx 7.2 \text{ days}$

ipynb
69cb15011bf816f7d0ca3e15e5da19944fe5d75b
Jupyter Notebook
a765d3ba35b2b3794b9b2cce038152682eeb2cb8
MIT
airicbear/calculus-homework
2019-01/2019-01-16.ipynb
a765d3ba35b2b3794b9b2cce038152682eeb2cb8
2019-02-09T01:17:25.000Z
2019-02-04T07:00:05.000Z
MIT
airicbear/calculus-homework
2019-01/2019-01-16.ipynb
a765d3ba35b2b3794b9b2cce038152682eeb2cb8
MIT
airicbear/calculus-homework
2019-01/2019-01-16.ipynb