(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-4, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-4, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R32768, L-4, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-4, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B32768, L-4, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier"; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = leftheader, inactive, L2, 12, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times"; fontset = leftfooter, inactive, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; paletteColors = 128; showRuler; currentKernel; ] :[font = subsection; inactive; noKeepOnOnePage; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 18; rightWrapOffset = 450] Math 225: Calculus III Assignment 1 :[font = subsection; inactive; noKeepOnOnePage; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 18; rightWrapOffset = 450] Name: :[font = subsection; inactive; noKeepOnOnePage; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 18; rightWrapOffset = 450] Section: :[font = text; inactive; preserveAspect; startGroup] I affirm that the solutions presented in this assignment are entirely my own work. :[font = subsection; inactive; noKeepOnOnePage; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 18; rightWrapOffset = 450; endGroup] Signature: :[font = subsection; inactive; preserveAspect; startGroup] Instructions :[font = text; inactive; preserveAspect] This notebook is an introduction to Mathematica and some of its basic functions which we shall be using throughout the course. You should look through the notebooks in the Notebook folder (most of these are reprinted in the back of the Lecture Notes), especially the Introduction notebook. Mathematica reference books are available in the labs. Be sure to check out Getting Started... and Shortcuts... in the Help menu. Below you will find some simple examples of how to execute Mathematica commands. Each example is followed by a problem for which you must type in a solution, mimicking the preceding example. Before you move on to the next problem, you should "clear" the variables you used in the current probem, so Mathematica won't remember any special values or expression you may have assigned to them. To do this use the command, Clear[x,y,...] listing any variable names you used. If you get unexpected expressions back from Mathematica, try clearing the variable names and starting over. You may need to use the command Remove[x,y,...] (a more "powerful' version of Clear[]) or even save, quit, and restart Mathematica to get back to normal. If a section of this notebook seems to "disappear" it may be because a "cell" has been "closed". A cell is one or more lines in a notebook grouped together. The cell is indicated by a bar on the right hand side of the cell. To select a cell, click on this bar. To open or close a cell double-click on this bar. Before you print out the assignment, make sure Show In/Out Names is NOT checked in the File menu. The notebook will print with many fewer lines. It would also be a good idea to close this Intructions cell and all of the Example cells (double-click on the bar on the far right) before printing. The following Initialization cell should always be executed before you type in any other statements. You were asked when you opened the notebook if you wanted to do this. You should normally click OK to such a question. If you did not click OK, select the cell below by clicking on the bar on the right and then hit the ENTER key. ;[s] 37:0,0;36,1;47,0;268,2;280,0;291,1;302,0;368,2;386,0;391,2;403,0;411,2;415,0;482,1;493,0;723,1;734,0;842,3;861,0;942,1;953,0;1038,3;1053,0;1084,3;1091,0;1125,1;1137,0;1520,2;1537,0;1560,2;1564,0;1661,2;1672,0;1693,2;1700,0;1783,2;1797,0;2100,-1; 4:19,13,9,Times,0,12,0,0,0;6,13,9,Times,2,12,0,0,0;9,13,9,Times,1,12,0,0,0;3,13,10,Courier,1,12,0,0,0; :[font = subsubsection; inactive; noKeepOnOnePage; preserveAspect; leftNameWrapOffset = 18; rightWrapOffset = 450; startGroup] Initialization :[font = input; initialization; noKeepOnOnePage; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 18; rightWrapOffset = 450; endGroup; endGroup] *) < -2^(-1/2), y -> -2^(-1/2)}, {x -> 2^(-1/2), y -> 2^(-1/2)}, {x -> -I*3^(1/2), y -> 2}, {x -> I*3^(1/2), y -> 2}, {y -> -1, x -> 0}, {y -> 1, x -> 0}} ;[o] 1 1 {{x -> -(-------), y -> -(-------)}, Sqrt[2] Sqrt[2] 1 1 {x -> -------, y -> -------}, {x -> -I Sqrt[3], y -> 2}, Sqrt[2] Sqrt[2] {x -> I Sqrt[3], y -> 2}, {y -> -1, x -> 0}, {y -> 1, x -> 0}} :[font = text; inactive; preserveAspect] To convert to decimal approximations: :[font = input; preserveAspect; startGroup] N[%] :[font = output; output; inactive; preserveAspect; endGroup] {{x -> -0.7071067811865475, y -> -0.7071067811865475}, {x -> 0.7071067811865475, y -> 0.7071067811865475}, {x -> -1.732050807568877*I, y -> 2.}, {x -> 1.732050807568877*I, y -> 2.}, {y -> -1., x -> 0}, {y -> 1., x -> 0}} ;[o] {{x -> -0.707107, y -> -0.707107}, {x -> 0.707107, y -> 0.707107}, {x -> -1.73205 I, y -> 2.}, {x -> 1.73205 I, y -> 2.}, {y -> -1., x -> 0}, {y -> 1., x -> 0}} :[font = text; inactive; preserveAspect] Note that some of these answers contain I which stands for Sqrt[-1]. You should ignore solutions that have I in them. ;[s] 7:0,0;40,1;41,0;59,1;67,0;107,1;108,0;118,-1; 2:4,13,9,Times,0,12,0,0,0;3,13,10,Courier,1,12,0,0,0; :[font = text; inactive; preserveAspect] You can also use NSolve[]: ;[s] 3:0,0;17,1;25,0;27,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,10,Courier,1,12,0,0,0; :[font = input; preserveAspect; startGroup] NSolve[{2 x^2 - 2 x y - x^2 y + x y^2 ==0, x^2 + y^2 ==1}] :[font = output; output; inactive; preserveAspect; endGroup] {{x -> -0.7071067811865475, y -> -0.7071067811865475}, {x -> -(4.028959161996589*10^-27) - 1.732050807568877*I, y -> 2.}, {x -> -(4.028959161996589*10^-27) + 1.732050807568877*I, y -> 2.}\ , {x -> 0.7071067811865475, y -> 0.7071067811865475}, {y -> -1., x -> 0.}, {y -> 1., x -> 0.}} ;[o] {{x -> -0.707107, y -> -0.707107}, -27 {x -> -4.02896 10 - 1.73205 I, y -> 2.}, -27 {x -> -4.02896 10 + 1.73205 I, y -> 2.}, {x -> 0.707107, y -> 0.707107}, {y -> -1., x -> 0.}, {y -> 1., x -> 0.}} :[font = text; inactive; preserveAspect; endGroup] Numbers like -4.02896 10^(-27) which are tiny in comparison with the other numbers in the solution should be treated as 0; they are the result of approximation errors inherit in the numerical methods used. ;[s] 5:0,0;13,1;30,0;120,1;121,0;206,-1; 2:3,13,9,Times,0,12,0,0,0;2,13,10,Courier,1,12,0,0,0; :[font = subsubsection; inactive; noKeepOnOnePage; preserveAspect; leftNameWrapOffset = 18; rightWrapOffset = 450; startGroup] Problem 4 :[font = text; inactive; preserveAspect] Solve the system of equations x^2 y - 2 x y - x^2 + 2 x ==0, x^2 - y^2 == 5 ;[s] 2:0,0;30,1;76,-1; 2:1,13,9,Times,0,12,0,0,0;1,13,10,Courier,1,12,0,0,0; :[font = subsubsection; inactive; noKeepOnOnePage; preserveAspect; leftNameWrapOffset = 18; rightWrapOffset = 450] Solution :[font = input; preserveAspect; endGroup] :[font = subsubsection; inactive; noKeepOnOnePage; preserveAspect; leftNameWrapOffset = 18; rightWrapOffset = 450; startGroup] Example 5 :[font = text; inactive; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 18; rightWrapOffset = 450] Plot the graph of the function x + Sin[x]. Plot the graph of the function x y + Sin[x y]. Plot the graph of the curve {t^2, t^3}. Plot the graph of the curve {t, t^2, t^3}. ;[s] 9:0,0;31,1;41,0;75,1;89,0;119,1;129,0;159,1;172,0;174,-1; 2:5,13,9,Times,0,12,0,0,0;4,13,10,Courier,1,12,0,0,0; :[font = subsubsection; inactive; noKeepOnOnePage; preserveAspect; leftNameWrapOffset = 18; rightWrapOffset = 450] Solution :[font = text; inactive; preserveAspect] To plot a function of 1 variable use Plot[]. ;[s] 3:0,0;37,1;43,0;45,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,10,Courier,1,12,0,0,0; :[font = input; preserveAspect; startGroup] Plot[x + Sin[x], {x,0,4Pi}] :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 174; endGroup; pictureID = 19322] :[font = text; inactive; preserveAspect] For a function of two variables, use Plot3D[]: ;[s] 3:0,0;37,1;45,0;47,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,10,Courier,1,12,0,0,0; :[font = input; preserveAspect; startGroup] Plot3D[x y + Sin[x y], {x,0,2Pi}, {y,0,2Pi}] :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 231; endGroup; pictureID = 21068] :[font = text; inactive; preserveAspect] For a curve in the plane use ParametricPlot[]: ;[s] 3:0,0;29,1;45,0;47,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,10,Courier,1,12,0,0,0; :[font = input; preserveAspect; startGroup] ParametricPlot[{t^2,t^3}, {t,-1,1}] :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureLeft = 33; pictureWidth = 282; pictureHeight = 174; endGroup; pictureID = 10760] :[font = text; inactive; preserveAspect] There are many options you can give to the plotting functions. You may want to override Mathematica's choices for scaling the axes and cropping the plot. For example, to get a more "natural" picture of the above graph, I set the scale for both axes to be the same (AspectRatio->1) and explicitly gave the range for the x and y axes. ;[s] 9:0,0;88,1;99,0;265,2;279,0;319,2;320,0;325,2;326,0;333,-1; 3:5,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;3,13,10,Courier,1,12,0,0,0; :[font = input; preserveAspect; startGroup] ParametricPlot[{t^2,t^3}, {t,-1,1}, AspectRatio->1, PlotRange->{{0,1},{-1,1}}] :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup; pictureID = 18708] :[font = text; inactive; preserveAspect] For curves in space, use ParametricPlot3D[]: ;[s] 3:0,0;25,1;43,0;45,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,10,Courier,1,12,0,0,0; :[font = input; preserveAspect; startGroup] ParametricPlot3D[{t,t^2,t^3}, {t,-1,1}] :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 261; pictureHeight = 287; endGroup; pictureID = 5913] :[font = text; inactive; preserveAspect; endGroup] This curve is a bit hard to see. We'll talk about how to better render such pictures later in the course. :[font = subsubsection; inactive; noKeepOnOnePage; preserveAspect; leftNameWrapOffset = 18; rightWrapOffset = 450; startGroup] Problem 5 :[font = text; inactive; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 18; rightWrapOffset = 450] Plot the graph of the function Sin[x]/(4+x^2). Plot the graph of the function Sin[x]+Cos[y]. Plot the graph of the curve {Cos[t], Sin[t]}. Plot the graph of the curve {t/10, Cos[t], Sin[t]}. ;[s] 9:0,0;31,1;45,0;79,1;92,0;122,1;138,0;168,1;190,0;192,-1; 2:5,13,9,Times,0,12,0,0,0;4,13,10,Courier,1,12,0,0,0; :[font = subsubsection; inactive; noKeepOnOnePage; preserveAspect; leftNameWrapOffset = 18; rightWrapOffset = 450] Solution :[font = input; noKeepOnOnePage; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 18; rightWrapOffset = 450; endGroup] ^*)