\documentclass{article} \usepackage{amsmath} \usepackage[usenames,dvipsnames,svgnames]{xcolor} \usepackage{tkz-euclide,tkz-fct} \usepackage{enumerate} % uncomment to suppress solutions %\usepackage[pdftex,nosolutions,pointsonleft]{eqexam} % Uncomment to see solutions \usepackage[pdftex,answerkey,pointsonleft]{eqexam} \title{Quiz \#2} \author{David Arnold} \subject{Math 55 --- Differential Equations} \university{College of the Redwoods} \begin{document} \maketitle \begin{exam}{Quiz2} \begin{instructions} This quiz is open notes, open book. This includes any supplementary texts or online documents. You must answer all of the exercises on your own. You are not allowed to work in groups or pairs on the quiz. You are not allowed to enlist the aid of a tutor, classmate, or friend to help with the quiz. All work must be your own. Place your solution to each problem in the space provided. \end{instructions} \begin{problem}[10] Solving the following initial value problem. Show all the steps, then state the interval of existence (the domain of the solution). Use MATLAB to plot the result on an appropriate domain. Include a printout of the plot with your quiz result. \begin{equation*} \frac{dy}{dx}=\frac{x}{1+2y},\quad y(-1)=0 \end{equation*} \begin{solution} Start with \begin{align*} \frac{dy}{dx}&=\frac{x}{1+2y}\\ \intertext{and separate the variables.} (1+2y)\,dy&=x\,dx\\ \intertext{Integrate.} y+y^2&=\frac12x^2+C \end{align*} The initial condition is $y(-1)=0$. Substitute $-1$ for $x$ and 0 for $y$ in the last result and solve for $C$. \begin{align*} (0)+(0)^2&=\frac12(-1)^2+C\\ 0&=\frac12+C\\ C&=-\frac12 \end{align*} Thus, an implicit solution is \begin{align*} y+y^2&=\frac12x^2-\frac12\\ \intertext{Multiply both sides by 2.} 2y+2y^2&=x^2-1 \end{align*} Now, in order to determine the interval of existence, we'll need an explicit solution for $y$, so use the quadratic formula to solve for $y$. First, make one side zero. \begin{align*} 2y^2+2y+(1-x^2)&=0 \end{align*} Now use the quadratic formula. \begin{align*} y&=\frac{-2\pm\sqrt{4-8(1-x^2)}}{4}\\ y&=\frac{-2\pm\sqrt{8x^2-4}}{4}\\ y&=\frac{-2\pm2\sqrt{2x^2-1}}{4}\\ y&=\frac{-1\pm\sqrt{2x^2-1}}{2}\\ \end{align*} In order that $y(-1)=0$, we must choose the solution \begin{equation*} y=\frac{-1+\sqrt{2x^2-1}}{2}. \end{equation*} To determine the interval existence, we note that we cannot take the square root of a negative number. Hence, the expression under the radical must be greater than or equal to zero. \begin{align*} 2x^2-1&\ge 0\\ \intertext{Solve for $x$.} x^2&\ge \frac12\\ \intertext{Take the square root of both sides.} \sqrt{x^2}&\ge \frac{\sqrt{2}}{2}\\ \intertext{Remember that the nonnegative square root of $x^2$ is $|x|$. That is, $\sqrt{x^2}=|x|$. Thus, we have:} |x|&\ge \frac{\sqrt2}{2} \end{align*} Hence, the domain of this function is \begin{equation*} \left(-\infty,-\frac{\sqrt2}{2}\right]\cup\left[\frac{\sqrt2}{2},\infty\right). \end{equation*} Finally, because $y(-1)=0$, our solution must go through the point $(-1,0)$. Hence the interval of existence is \begin{equation*} \left(-\infty,-\frac{\sqrt2}{2}\right]. \end{equation*} We can now use MATLAB to plot the result. Start by using the interval of existence to help select a good range of $x$-values. \begin{verbatim} x=linspace(-10,-sqrt(2)/2,500); \end{verbatim} Next, use the solution to calculate the $y$-values. \begin{verbatim} y=(-1+sqrt(2*x.^2-1))/2; \end{verbatim} Plot the graph of the solution, then annotate the plot. \begin{verbatim} plot(x,y) grid on xlabel('x-axis') ylabel('y-axis') title('The solution of y''=x/(1+2y), y(-1)=0.') \end{verbatim} Let's plot the initial condition. We create a handle, then use the handle to set the edge and face color. \begin{verbatim} hl=line(-1,0,'Marker','o'); set(hl,... 'MarkerEdgeColor','black',... 'MarkerFaceColor',[255,204,153]/255) \end{verbatim} Next, we label the point, then use a handle to set the background and edge color, as well as increasing the margin size. \begin{verbatim} ht=text(-0.5,0.5,'(-1,0)'); set(ht,... 'Margin',4,... 'BackgroundColor',[255,204,153]/255,... 'EdgeColor','black') \end{verbatim} Now we can save the plot to be used in our \LaTeX\ document. \begin{verbatim} set(gcf,'PaperSize',[4,3]) set(gcf,'PaperPosition',[0,0,4,3]) saveas(gcf,'quiz2plot','pdf') \end{verbatim} The resulting plot is shown in Figure~\ref{fig:plot}. \begin{figure} \centering \includegraphics{quiz2plot} \caption{The solution of $y'=x/(1+2y),\quad y(-1)=0$.\label{fig:plot}} \end{figure} \end{solution} \end{problem} \qNewPage \begin{problem}[10] When a potato is removed from an oven, its initial temperature is $450^{\circ}$ F. The potato is placed on a plate in a kitchen whose ambient temperature is $70^{\circ}$ F. After 2 minutes, the temperature of the potato is $300^{\circ}$~F. Starting from the time the potato is removed from the oven, how long will it take the temperature of the potato to lower to $100^{\circ}$ F ? Round your answer to the nearest tenth of a minute. \emph{Note: No credit will be awarded for starting with a formula, plugging in numbers, then arriving at an answer. Start with the fact that the rate at which the temperature of the potato decreases is proportional to the difference between the temperature of the potato and the ambient temperature. Set up the initial value problem, use separation of variables to solve the result, then use the given numbers to find the time required for the temperature to lower to $100^{\circ}$ F.} \begin{solution} To start with, we assume that the rate at which the temperature $T$ is changing with respect to time $t$ is proportional to the difference between the ambient temperature $A$ and the temperature $T$. \begin{align*} \frac{dT}{dt}=k(A-T)\\ \intertext{Separate the variables.} \frac{dT}{A-T}&=kdt\\ \intertext{Integrate.} -\ln(A-T)&=kt+K\\ \intertext{Multiply both sides by $-1$. Note that the negative of an arbitrary constant is just another arbitrary constant.} \ln(A-T)&=-kt+K \\ \intertext{Now, solve for $T$. Note that $e$ raised to an arbitrary constant $K$ is just another arbitrary constant $K$.} A-T&=e^{-kt+K}\\ A-T&=e^{K}e^{-kt}\\ A-T&=Ke^{-kt} \end{align*} Now, $T(0)=T_0$, so the initial temperature at time $t=0$ is $T_0$. Substitute $T_0$ for $T$ and 0 for $t$ to determine the constant $K$. \begin{align*} A-T_0&=Ke^{-k(0)}\\ A-T_0&=K \end{align*} Substitute this result for $K$ to obtain \begin{equation*} A-T=(A-T_0)e^{-kt} \end{equation*} Now, solve for $T$. \begin{align*} -T&=-A+(A-T_0)e^{-kt}\\ T&=A-(A-T_0)e^{-kt}\\ T&=A+(T_0-A)e^{-kt} \end{align*} We're given the initial temperature is $T_0=450^\circ$ F and the ambient temperature is $A=70^{\circ}$ F. \begin{align*} T&=70+(450-70)e^{-kt}\\ T&=70+380e^{-kt} \end{align*} Next, we're given that the temperature after $t=2$ minutes is $T=300^{\circ}$ F. \begin{align*} 300&=70+380e^{-k(2)}\\ \intertext{Solve for $k$.} 230&=380e^{-2k}\\ \frac{23}{38}&=e^{-2k}\\ -2k&=\ln\frac{23}{38}\\ k&=-\frac12\ln\frac{23}{38}\\ \end{align*} Substitute this result into the equation $T=70+380e^{-kt} $. \begin{equation*} T=70+380e^{(t/2)\ln(23/38)} \end{equation*} Finally, we're asked how long it takes the temperature to lower to $T=100^{\circ}$ F. \begin{align*} 100&=70+380e^{(t/2)\ln(23/38)} \\ \intertext{Solve for $t$.} 30&=380e^{(t/2)\ln(23/38)} \\ \frac{3}{38}&=e^{(t/2)\ln(23/38)} \\ \frac{t}{2}\ln\frac{23}{38}&=\ln\frac{3}{38}\\ t&=\frac{2\ln(3/38)}{\ln(23/38)}\\ \intertext{Using a calculator, } t&\approx 10.1 \end{align*} Hence, the time it takes to cool to $100^{\circ}$ F is approximately 10.1 minutes. \end{solution} \end{problem} \end{exam} \end{document}