TD 5
Index
Optimization problems
Exercise 1
A company manufactures and sells a product. The revenue $R$ and cost $C$ functions are given by (...) The company's profit $P(x)$ is defined as:$$\begin{aligned} R(x) &= 50x - 0.5x^2 \\ C(x) &= 20x + 200 \\ P(x) &= R(x) - C(x) \\ \end{aligned}$$
1. Formulate the Profit Function: $P(x)$$$\begin{aligned} P(x) &= (50x - 0.5x^2) - (20x + 200) \\ &= -\frac{1}{2}x^2 + 30x - 200 \\ \end{aligned}$$
2. Determine the number of units $x$ that maximizes the profit and calculate the maximum profit.$$\begin{aligned} P'(x^*) &= -x^* + 30 = 0 \\ x^* &= 30 \\ \end{aligned}$$ $$\begin{aligned} P(x^*) &= P(30) = -\frac{1}{2}(30)^2 + 30(30) - 200 \\ &= 30(15) - 200 = 250 \\ \end{aligned}$$
3. State the optimal production level and the corresponding profit.The optimal production level is reached when producing and selling 30 units, which corresponds to a profit of 250.
Exercise 2
(...) a rectangular garden that is to be enclosed by fencing on all four sides (...) the garden will be divided into two equal-sized sections by a fence that runs parallel to one of the sides. The total length of the fencing available is 200 meters. (...) maximize the area (...).
1. Express the area $A$ of the garden as a function of $x$ and $y$.$$A(x,y) = x*y$$ Note that for a rectangle, the choice of assigning the longest side to either $x$ and $y$ axis is arbitrary. For this example, $x$ wil correspond to the longest side, therefore $x \geq y$ (to also include the edge case where $x=y$ i.e. the rectangle is a square).
2. Write down the constraint on the lengths $x$ and $y$ based on the total length of the fencing.Let $P(x,y)$ be the perimeter of the fence as a function of $x$ and $y$. The total perimeters consists of the fence that encloses the garden, which is a simple rectangle perimeter of $2x+2y$, plus the fence $m$ that runs through its middle. This fence is parallel to one of the sides, meaning that either $m=x$ or $m=y$. This means that there are also two possibilities for $P(x,y) = 2x + 2y + m$: $$\begin{aligned} P(x,y) &= \left \{ \begin{align*} P_{long} &= 2x+2y+x = 3x+2y \\ &\text{i.e. middle fence parallel to the long side} \\ &&\\ P_{short} &= 2x+2y+y = 2x+3y \\ &\text{i.e. middle fence parallel to the short side} \\ \end{align*} \right . \end{aligned}$$ For choosing which definition of $P(x,y)$ makes more sense, one must consider the context of this problem. Consider the following:
- The perimeter is given as a constant $200$, meaning that for either choice, $x$ and $y$ need to "balance out" inside $P(x,y)$ to yield this concrete value.
- $A(x,y)=x*y$ is to be maximized, which implies that having larger values of $x$ and $y$ is desired in any case.
- A faster growing $P_{fast}(x,y)$ yields higher values of $P$ for lower values of $x$ and $y$. In other words, $P_{fast}(x,y)$ achieves a value of $k$ when its values of $x$ and $y$ are still low, relative to the values of $x$ and $y$ that a slower candidate $P_{slow}(x,y)$ needs to reach the same $k$.
3. Express the area $A$ as a function of $x$ only, using the constraint.$$\begin{aligned} 200 &= 2x + 3y \\ 3y &= 200 - 2x \\ y &= \frac{2}{3}(100 - x) \\ &&\\ A(x,y) &= xy \\ A(x) &= \frac{2x}{3}(100 - x) \\ &= -\frac{2}{3}x^2 + \frac{200}{3}x \\ \end{aligned}$$
4. Determine the dimensions $x$ and $y$ that maximize the area and calculate the maximum area.Note that $A(x)$ is a parabola facing downwards (given by $ax^2$, $a < 0$), which means it has a global maximum at the middle-point between its two roots. Furthermore, the factorized form of $A(x)$ hints directly at its roots, $x_{root} \in \{0,100\}$. The value of $x=x^*$ where the maximum occurs can then be easily computed: $$\begin{aligned} argmax(A(x)) &= \frac{x_{root_0} + x_{root_1}}{2} = \frac{0 + 100}{2} \\ x^* &= 50 \\ \end{aligned}$$ This also leads to the optimal value of $y = y^*$, as well as the optimal area $A^*$: $$\begin{aligned} y &= \frac{2}{3}(100 - x) \\ y^* &= \frac{2}{3}(100 - x^*) \\ y^* &= \frac{2}{3}(100 - 50) \\ y^* &= \frac{100}{3} \approx 33.33 \\ &&\\ A^* &= A(x^*, y^*) \\ &= x^*y^* \\ &= (50)(\frac{100}{3}) \\ &= \frac{5000}{3} \approx 1666.67 \\ \end{aligned}$$
Exercise 3
The volume of a cube decreases at a rate of $2cm^3/hr$. What is the rate of change of the surface area when the volume is $343cm^3$?$$\begin{aligned} \frac{dV}{dt} = -2 && V =343 && \frac{dA}{dt}? \\ \end{aligned}$$ Find a relationship between the volume and area of the cube, represented as the functions $V(l)$ and $A(l)$ respectively, with $l$ being the length in centimeters of the cube's edges. In other words, find a way to represent volume as a function of area instead $$\begin{aligned} A(l) = l^2 &\Rightarrow l = \sqrt[2]{A} \\ V(l) = l^3 &\Rightarrow l = \sqrt[3]{V} \\ &\therefore V(A) = A^{\frac{3}{2}} \\ \end{aligned}$$ Consider the value of $l$ under the given condition of $V = 343$ $$\begin{aligned} V(l) = l^3 &= 343 \\ l &= \sqrt[3]{343} = 7 \\ \end{aligned}$$ When presented with the condition $\frac{d}{dt}V=-2$, it is natural to assume it refers to $\frac{d}{dt}V(t)=-2$. But as presented above, the volume can also be represented as a function of area, hence this condition would be interpreted as $\frac{d}{dt}V(A(t))=-2$ instead. This is useful because now the chain rule can be applied to this derivative $$\begin{aligned} \frac{d}{dt}V(A(t)) &= -2 \\ \frac{d}{dA}V(A) \frac{d}{dt}A(t) &= -2 \\ (\frac{3}{2}A^{\frac{1}{2}}) \frac{d}{dt}A(t) &= -2 \\ (\frac{3}{2}l) \frac{d}{dt}A(t) &= -2 \\ (\frac{21}{2}) \frac{d}{dt}A(t) &= -2 \\ \frac{d}{dt}A(t) &= -2 (\frac{2}{21}) \\ \frac{d}{dt}A(t) &= \frac{-4}{21} \\ \end{aligned}$$
Taylor expansions
Exercise 1a
Taylor expansion to the second order of $tan(x)$ around $a=0$.$$\begin{aligned} tan(x) &\approx tan(a) + \frac{tan'(a)}{1!}(x-a) + \frac{tan''(a)}{2!}(x-a)^2 \\ &= tan(0) + (cos^{-2}(a))(x-0) + (cos^{-2}(a))'\frac{(x-0)^2}{2} \\ &= (cos^{-2}(0))x + (-2)(cos^{-3}(a))(-sin(a))\frac{x^2}{2} \\ &= (1)x + (-2)(cos^{-3}(0))(-sin(0))\frac{x^2}{2} \\ &= x + (-2)(1)(0)\frac{x^2}{2} \\ &= x \\ \end{aligned}$$
Exercise 1b
Taylor expansion to the second order of $\frac{1}{x}$ around $a=1$.$$\begin{aligned} x^{-1} &\approx (a^{-1}) + \frac{(a^{-1})'}{1!}(x-a) + \frac{(a^{-1})''}{2!}(x-a)^2 \\ &= (1^{-1}) + (-a^{-2})(x-1) + (-a^{-2})'\frac{(x-1)^2}{2} \\ &= 1 -(1)^{-2}(x-1) + (2a^{-3})\frac{(x-1)^2}{2} \\ &= 1 - (x-1) + (2)(1)^{-3}\frac{(x-1)^2}{2} \\ &= 1 - x + 1 + (x-1)^2 \\ &= 1 - x + 1 + x^2 - 2x + 1 \\ &= x^2-3x+3 \\ \end{aligned}$$
Exercise 1c
Taylor expansion to the second order of $sin(x)$ around $a=\frac{\pi}{4}$.$$\begin{aligned} sin(x) &\approx sin(a) + \frac{sin'(a)}{1!}(x-a) + \frac{sin''(a)}{2!}(x-a)^2 \\ &= sin(\frac{\pi}{4}) + (cos(a))(x-\frac{\pi}{4}) + (cos(a))'\frac{(x-\frac{\pi}{4})^2}{2} \\ &= sin(\frac{\pi}{4}) + cos(\frac{\pi}{4})(x-\frac{\pi}{4}) + (-sin(a))\frac{(x-\frac{\pi}{4})^2}{2} \\ &= sin(\frac{\pi}{4}) + cos(\frac{\pi}{4})(x-\frac{\pi}{4}) - sin(\frac{\pi}{4})\frac{(x-\frac{\pi}{4})^2}{2} \\ &= sin(\frac{\pi}{4}) + sin(\frac{\pi}{4})(x-\frac{\pi}{4}) - sin(\frac{\pi}{4})\frac{(x-\frac{\pi}{4})^2}{2} \\ &= sin(\frac{\pi}{4}) (1 + (x-\frac{\pi}{4}) - \frac{(x-\frac{\pi}{4})^2}{2} ) \\ &= \frac{\sqrt{2}}{2} (x + 1 - \frac{\pi}{4} - \frac{1}{2}(x-\frac{\pi}{4})^2 ) \\ \end{aligned}$$
Exercise 2
The equation $e^{2x} = 3x^2$ has a solution close to zero. With the help of a Taylor expansion for the function $e^{2x}$, find an approximate solution for the equation.$$\begin{aligned} e^{2x} &= 3x^2 \\ e^0 + \frac{2e^0}{1!}x + \frac{4e^0}{2!}x^2 &\approx 3x^2 \\ 1 + 2x + 2x^2 - 3x^2 &\approx 0 \\ x^2 - 2x - 1 &\approx 0 \\ (x^2 - 2x + 1) - \sqrt{2}^2 &\approx 0 \\ (x - 1 + \sqrt{2})(x - 1 - \sqrt{2}) &\approx 0 \\ \end{aligned}$$ $$\begin{aligned} x_0 &\in \{1-\sqrt{2}, 1+\sqrt{2}\} \\ &\approx \{-0.41, 2.41\} \\ \end{aligned}$$ This approximation is being performed near $0$, so between the two candidate solutions obtained above, $x_0$ should have that one closest to $0$. Therefore, $x_0 = 1-\sqrt{2} \approx -0.41$ is the approximate solution for $e^{2x} = 3x^2$.
Exercise 3a
With the help of Taylor expansions, compute $\lim_{x \to 0} \frac{sin(x) - x}{2x^3}$$$\begin{aligned} &\lim_{x \to 0} \frac{sin(x) - x}{2x^3} \\ = &\lim_{x \to 0} \frac{1}{2x^3} (sin(x) - x) \\ \approx &\lim_{x \to 0} \frac{1}{2x^3} (sin(0) + cos(0)x - sin(0)\frac{x^2}{2} - cos(0)\frac{x^3}{6} - x) \\ = &\lim_{x \to 0} \frac{1}{2x^3} ((0) + (1)x - (0)\frac{x^2}{2} - (1)\frac{x^3}{6} - x) \\ = &\lim_{x \to 0} \frac{1}{2x^3} (x - \frac{x^3}{6} - x) \\ = &\lim_{x \to 0} \frac{1}{2x^3} (-\frac{x^3}{6}) \\ = &\lim_{x \to 0} -\frac{x^3}{12x^3} \\ = &\lim_{x \to 0} -\frac{1}{12} \\ = &-\frac{1}{12} \\ \end{aligned}$$
Exercise 3b
With the help of Taylor expansions, compute $\lim_{x \to 0} \frac{x^2 e^x}{cos(x)-1}$$$\begin{aligned} &\lim_{x \to 0} \frac{x^2 e^x}{cos(x)-1} \\ \approx &\lim_{x \to 0} \frac{x^2 e^x}{cos(0)-sin(0)x-cos(0)\frac{x^2}{2}-1} \\ = &\lim_{x \to 0} \frac{x^2 e^x}{(1)-(0)x-(1)\frac{x^2}{2}-1} \\ = &\lim_{x \to 0} \frac{x^2 e^x}{1-\frac{x^2}{2}-1} \\ = &\lim_{x \to 0} \frac{x^2 e^x}{-\frac{x^2}{2}} \\ = &\lim_{x \to 0} -2e^x \\ = &-2 \\ \end{aligned}$$
Exercise 3c
With the help of Taylor expansions, compute $\lim_{x \to 0} \frac{e^x-sin(x)-cos(x)}{e^{x^2} - e^{x^3}}$For simplicity, let's first consider the first and second derivative of $e^{x^n}$ with respect to $x$ $$\begin{aligned} (e^{x^n})' &= (e^{x^n})(x^n)' \\ &= (e^{x^n})(nx^{n-1}) \\ && \\ (e^{x^n})'' &= ((e^{x^n})(nx^{n-1}))' \\ &= (e^{x^n})'(nx^{n-1}) + (e^{x^n})(nx^{n-1})' \\ &= (e^{x^n})(nx^{n-1})(nx^{n-1}) + (e^{x^n})(n(n-1)x^{n-2}) \\ &= (e^{x^n}) ((nx^{n-1})^2 + n(n-1)x^{n-2}) \\ &= ne^{x^n}(nx^{2n-2} + (n-1)x^{n-2}) \\ \end{aligned}$$ Now consider both derivatives for $n=2$ and $n=3$ as $x \to 0$, $$\begin{aligned} \lim_{x \to 0}(e^{x^2})' &= \lim_{x \to 0} (e^{x^2})(2x^{2-1}) \\ &= \lim_{x \to 0} (e^{x^2})(2x) = 0 \\ \therefore \lim_{x \to 0}(e^{x^2})' &= 0 \\ && \\ \lim_{x \to 0}(e^{x^3})' &= \lim_{x \to 0} (e^{x^3})(3x^{3-1}) \\ &= \lim_{x \to 0} (e^{x^3})(3x^2) = 0 \\ \therefore \lim_{x \to 0}(e^{x^3})' &= 0 \\ && \\ \lim_{x \to 0}(e^{x^2})'' &= \lim_{x \to 0} 2e^{x^2}(2x^{2(2)-2} + (2-1)x^{2-2}) \\ &= \lim_{x \to 0} 2e^{x^2}(2x^2 + x^{0}) \\ &= \lim_{x \to 0} 2e^{x^2}(2x^2) + \lim_{x \to 0} 2e^{x^2}(x^{1-1}) \\ &= (0) + \lim_{x \to 0} 2e^{x^2}(\frac{x}{x}) = 2(1)(1) = 2 \\ \therefore \lim_{x \to 0}(e^{x^2})'' &= 2 \\ && \\ \lim_{x \to 0}(e^{x^3})'' &= \lim_{x \to 0} 3e^{x^3}(3x^{2(3)-2} + (3-1)x^{3-2}) \\ &= \lim_{x \to 0} 3e^{x^3}(3x^4 + 2x) = 0 \\ \therefore \lim_{x \to 0}(e^{x^3})'' &= 0 \\ \end{aligned}$$ Using these, the following limit can be approximated with a second order Taylor expansion $$\begin{aligned} &\lim_{x \to 0} \frac{e^x-sin(x)-cos(x)}{e^{x^2} - e^{x^3}} \\ \approx &\lim_{x \to 0} \frac{(e^0+e^0x+e^0\frac{x^2}{2}) - (sin(0)+cos(0)x-sin(0)\frac{x^2}{2}) - (cos(0)-sin(0)x-cos(0)\frac{x^2}{2})} {(e^{0^2}+(e^{0^2})'x+(e^{0^2})''\frac{x^2}{2}) - (e^{0^3}+(e^{0^3})'x+(e^{0^3})''\frac{x^2}{2})} \\ = &\lim_{x \to 0} \frac{((1)+(1)x+(1)\frac{x^2}{2}) - ((0)+(1)x-(0)\frac{x^2}{2}) - ((1)-(0)x-(1)\frac{x^2}{2})} {((1)+(0)x+(2)\frac{x^2}{2}) - ((1)+(0)x+(0)\frac{x^2}{2})} \\ = &\lim_{x \to 0} \frac{1 + x + \frac{x^2}{2} - x - 1 + \frac{x^2}{2}} {1 + x^2 - 1} \\ = &\lim_{x \to 0} \frac{2\frac{x^2}{2}} {x^2} \\ = &\lim_{x \to 0} \frac{x^2}{x^2} \\ = &1 \\ \end{aligned}$$