(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 36377, 1137] NotebookOptionsPosition[ 31557, 997] NotebookOutlinePosition[ 32009, 1016] CellTagsIndexPosition[ 31966, 1013] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Phys 263 Notebook for 27 May 09", "Subtitle", CellChangeTimes->{{3.452417767667*^9, 3.4524177880629997`*^9}}], Cell["\<\ The goal again this week is to work through the homework problems, solving \ and plotting as we go.\ \>", "Text", CellChangeTimes->{{3.452417790653*^9, 3.452417831244*^9}}], Cell[CellGroupData[{ Cell["BTM 9.7.8", "Section"], Cell["The problem we do again and again is:", "Text", CellChangeTimes->{{3.4524178423710003`*^9, 3.452417860593*^9}}], Cell["\<\ Define our target function on the interval [-1,1]: (Choose one of these at a \ time)\ \>", "Text", CellChangeTimes->{{3.452443881825*^9, 3.452443890832*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], " ", "=", " ", RowBox[{"Exp", "[", RowBox[{"-", RowBox[{"Abs", "[", "x", "]"}]}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], " ", "=", " ", RowBox[{"Cosh", "[", "x", "]"}]}]], "Input", CellChangeTimes->{{3.452279271684*^9, 3.45227927627*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], " ", "=", RowBox[{"Exp", "[", "x", "]"}]}]], "Input", CellChangeTimes->{{3.452279271684*^9, 3.45227927627*^9}, { 3.4524439017469997`*^9, 3.4524439020480003`*^9}}], Cell["First choose the exp() basis functions:", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"\[Phi]", "[", RowBox[{"n_", ",", "x_"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"Sqrt", "[", "2", "]"}]}], ")"}], " ", RowBox[{"Exp", "[", RowBox[{"\[Pi]", " ", "I", " ", "n", " ", "x"}], "]"}]}]}]], "Input"], Cell["Check that we normalized them correctly:", "Text"], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"\[Phi]", "[", RowBox[{"n", ",", "x"}], "]"}], "*", RowBox[{"\[Phi]", "[", RowBox[{ RowBox[{"-", "n"}], ",", "x"}], "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["And go compute the coefficients:", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"fm", "[", "m_", "]"}], " ", "=", " ", RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"f", "[", "x", "]"}], "*", RowBox[{"\[Phi]", "[", RowBox[{ RowBox[{"-", "m"}], ",", "x"}], "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"FullSimplify", "[", RowBox[{"%", ",", RowBox[{"Assumptions", "\[Rule]", RowBox[{"Element", "[", RowBox[{"m", ",", "Integers"}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.452279071473*^9, 3.4522790823389997`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"fm", "[", "m_", "]"}], " ", "=", " ", "%"}]], "Input", CellChangeTimes->{{3.452279094892*^9, 3.4522790978269997`*^9}}], Cell["Define the n-th degree approximation as:", "Text", CellChangeTimes->{{3.452417911352*^9, 3.452417921049*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"g", "[", RowBox[{"n_", ",", "x_"}], "]"}], " ", ":=", " ", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"fm", "[", "m", "]"}], "*", RowBox[{"\[Phi]", "[", RowBox[{"m", ",", "x"}], "]"}]}], ",", RowBox[{"{", RowBox[{"m", ",", RowBox[{"-", "n"}], ",", "n"}], "}"}]}], "]"}]}]], "Input"], Cell["And try it out:", "Text", CellChangeTimes->{{3.452417927843*^9, 3.452417929834*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"g", "[", RowBox[{"3", ",", "x"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Hue", "[", ".7", "]"}], ",", RowBox[{"Hue", "[", "0", "]"}]}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.452279106631*^9, 3.452279107461*^9}, { 3.4522793002279997`*^9, 3.452279308795*^9}, {3.452341005909*^9, 3.452341041954*^9}, {3.452417924144*^9, 3.4524179252019997`*^9}}], Cell["\<\ Now repeat using Sin and Cos. That is, instead of writing in terms of Exp[2\ \[Pi] n I x/L] with both positive and negative n, we trade for two kinds of \ basis functions, each defined for positive integers n:\ \>", "Text", CellChangeTimes->{{3.452417950748*^9, 3.45241796816*^9}, {3.452443276344*^9, 3.452443418094*^9}, {3.452443511273*^9, 3.452443524425*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"\[Phi]c", "[", RowBox[{"n_", ",", "x_"}], "]"}], " ", "=", " ", RowBox[{"Cos", "[", RowBox[{"n", " ", "\[Pi]", " ", "x"}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"\[Phi]s", "[", RowBox[{"n_", ",", "x_"}], "]"}], " ", "=", " ", RowBox[{"Sin", "[", RowBox[{"n", " ", "\[Pi]", " ", "x"}], "]"}]}]], "Input"], Cell["\<\ Checking that the normalization is right on this interval for a mode or two: \ (change the 3 to something else)\ \>", "Text", CellChangeTimes->{{3.452417970417*^9, 3.4524179812980003`*^9}, { 3.452443740222*^9, 3.452443765868*^9}}], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"\[Phi]c", "[", RowBox[{"3", ",", "x"}], "]"}], "^", "2"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["\<\ Note that for n=0 there is no distinct partner -n, and no trade to be made. \ So we keep \[Phi][0,x] to be the same as it ever was, the constant 1/Sqrt[L]. \ We can label this mode the n=0 term of the Cos terms, but note we need to \ overwrite the definition for \[Phi]c[0,x]:\ \>", "Text", CellChangeTimes->{{3.452443600609*^9, 3.452443731977*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"\[Phi]c", "[", RowBox[{"0", ",", "x_"}], "]"}], " ", "=", " ", RowBox[{"1", "/", RowBox[{"Sqrt", "[", "2", "]"}]}]}]], "Input", CellChangeTimes->{{3.452443734094*^9, 3.452443735098*^9}, {3.452443775021*^9, 3.4524438176219997`*^9}}], Cell["And get the coeffiecients.", "Text", CellChangeTimes->{{3.452417988027*^9, 3.4524179939379997`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"a", "[", "n_", "]"}], " ", "=", " ", RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"\[Phi]c", "[", RowBox[{"n", ",", "x"}], "]"}], "*", RowBox[{"f", "[", "x", "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"FullSimplify", "[", RowBox[{"%", ",", RowBox[{"Assumptions", "\[Rule]", RowBox[{"Element", "[", RowBox[{"n", ",", "Integers"}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.4522793287060003`*^9, 3.4522793424379997`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"b", "[", "n_", "]"}], " ", "=", " ", RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"\[Phi]s", "[", RowBox[{"n", ",", "x"}], "]"}], "*", RowBox[{"f", "[", "x", "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.452279138384*^9, 3.4522791434519997`*^9}}], Cell["\<\ Your job: assemble the modes in a g(n,x) function and Plot. Then repeat, using Cos and Sin for the function Exp[x] on the interval \ (-\[Pi],\[Pi]). Note that you'll need to modify the modes (and check their normalization) for \ the new interval.\ \>", "Text", CellChangeTimes->{{3.452417996514*^9, 3.4524180251949997`*^9}, { 3.4524180675889997`*^9, 3.452418148001*^9}, {3.4524430821879997`*^9, 3.452443099025*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["BTM 9.7.12", "Section", CellChangeTimes->{{3.452279416547*^9, 3.4522794175179996`*^9}}], Cell["\<\ Another example of the utility of Fourier transforms: they are the \"nice\" \ modes for the vibrating string. Suppose we pluck a string with a certain initial pattern of displacements, \ and for our first pass let's assume we start everything from rest (i.e. our particular solution will be a \ sum of Cos[\[Omega] t]'s with no Sin's).\ \>", "Text", CellChangeTimes->{{3.452418156936*^9, 3.4524182992139997`*^9}}], Cell["Define a starting shape for the string:", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], " ", "=", " ", RowBox[{ RowBox[{"2", "x", " ", RowBox[{"UnitStep", "[", RowBox[{ RowBox[{"(", RowBox[{"1", "/", "2"}], ")"}], "-", "x"}], "]"}]}], " ", "+", " ", RowBox[{"2", RowBox[{"(", RowBox[{"1", "-", "x"}], ")"}], RowBox[{"UnitStep", "[", RowBox[{"x", "-", RowBox[{"(", RowBox[{"1", "/", "2"}], ")"}]}], "]"}]}]}]}]], "Input"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["Fourier decompose in terms of sin():", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"\[Phi]", "[", RowBox[{"n_", ",", "x_"}], "]"}], " ", "=", " ", RowBox[{"Sin", "[", " ", RowBox[{"\[Pi]", " ", "n", " ", "x"}], "]"}]}]], "Input", CellChangeTimes->{{3.452418354152*^9, 3.452418355219*^9}}], Cell["\<\ Don't forget to check that is is OK: (actually this one isn't--- I'm asking \ you to fix it by changing the line above until the line below is coming out \ to its proper value of 1)\ \>", "Text", CellChangeTimes->{{3.452418317139*^9, 3.452418403949*^9}}], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"\[Phi]", "[", RowBox[{"12", ",", "x"}], "]"}], "^", "2"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["Now we can go on to get the coefficients:", "Text", CellChangeTimes->{{3.452418411094*^9, 3.45241841817*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"a", "[", "n_", "]"}], " ", "=", " ", RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"\[Phi]", "[", RowBox[{"n", ",", "x"}], "]"}], RowBox[{"f", "[", "x", "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]}]], "Input"], Cell["Sometimes it is clearer as a simple list:", "Text", CellChangeTimes->{{3.452418426124*^9, 3.452418433091*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"a", "[", "n", "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "5"}], "}"}]}], "]"}], " "}]], "Input", CellChangeTimes->{3.45227944677*^9}], Cell["Then assemble the modes and plot:", "Text", CellChangeTimes->{{3.452418440226*^9, 3.452418450374*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"g", "[", RowBox[{"n_", ",", "x_"}], "]"}], " ", ":=", " ", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"a", "[", "j", "]"}], "*", RowBox[{"\[Phi]", "[", RowBox[{"j", ",", "x"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "n"}], "}"}]}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"g", "[", RowBox[{"15", ",", "x"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["\<\ Once we have the coefficients (as determined from t=0 data) we can use them \ to form the solution at general t:\ \>", "Text", CellChangeTimes->{{3.4524184644049997`*^9, 3.452418513078*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"\[Psi]", "[", RowBox[{"n_", ",", "x_", ",", "t_"}], "]"}], " ", ":=", " ", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"a", "[", "j", "]"}], RowBox[{"\[Phi]", "[", RowBox[{"j", ",", "x"}], "]"}], RowBox[{"Cos", "[", RowBox[{"j", " ", "\[Pi]", " ", "t"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "n"}], "}"}]}], "]"}]}]], "Input"], Cell["Check out what the function is at some future time:", "Text", CellChangeTimes->{{3.452418533578*^9, 3.452418549637*^9}}], Cell[BoxData[ RowBox[{"\[Psi]", "[", RowBox[{"15", ",", "0", ",", ".1"}], "]"}]], "Input"], Cell["And the plot it:", "Text", CellChangeTimes->{{3.45241854005*^9, 3.452418562549*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"\[Psi]", "[", RowBox[{"15", ",", "x", ",", ".1"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}]}]}], "]"}]], "Input"], Cell["And of course, Animate:", "Text", CellChangeTimes->{{3.4524185705889997`*^9, 3.452418583784*^9}}], Cell[BoxData[ RowBox[{"Animate", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"\[Psi]", "[", RowBox[{"15", ",", "x", ",", "t"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"t", ",", ".1", ",", "2", ",", ".1"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.452358861318*^9, 3.452358862275*^9}}], Cell["\<\ If the function takes some time to compute, you can make a better movie by \ computing the frames once and for all:\ \>", "Text", CellChangeTimes->{{3.452418591402*^9, 3.452418622649*^9}}], Cell[BoxData[ RowBox[{"Table", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"\[Psi]", "[", RowBox[{"15", ",", "x", ",", "t"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"t", ",", ".1", ",", "2", ",", ".1"}], "}"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"ListAnimate", "[", "%", "]"}]], "Input", CellChangeTimes->{{3.4522796583570004`*^9, 3.452279667347*^9}}], Cell[TextData[{ "Your job: repeat for the function of problem 9.7.13, where the string \ length is L=\[Pi] and the initial displacement is:\n\"between 0 and \[Pi]/4, \ rises linearly from 0 to 1; from \[Pi]/4 to 3\[Pi]/4 falls linearly from 1 to \ -1; between 3\[Pi]/4 and \[Pi], rises from -1 back to 0\". Again, you'll \ need to change the limits of integration and the normalization of the modes \ above.\nAnd a piecewise continuous function can be written using ", StyleBox["Mathematica", FontSlant->"Italic"], "'s Piecewise construct.\nE.g. here is the triangle wave from above:\n" }], "Text", CellChangeTimes->{{3.452418893816*^9, 3.452418928558*^9}, { 3.4524189596140003`*^9, 3.45241896584*^9}, {3.452419082849*^9, 3.45241922501*^9}, {3.452444005587*^9, 3.4524441048640003`*^9}, { 3.452444253441*^9, 3.452444257961*^9}, {3.452444302016*^9, 3.452444310152*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], "=", RowBox[{"Piecewise", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"2", "x"}], ",", " ", RowBox[{"x", "<", RowBox[{"1", "/", "2"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"2", RowBox[{"(", RowBox[{"1", "-", "x"}], ")"}]}], ",", RowBox[{"x", ">", RowBox[{"1", "/", "2"}]}]}], "}"}]}], "}"}], "]"}]}]], "Input", CellChangeTimes->{{3.452444119677*^9, 3.452444155093*^9}, { 3.4524442392860003`*^9, 3.452444268307*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.4524442704189997`*^9, 3.45244427565*^9}}], Cell["\<\ Challenge: change the boundary conditions so we start with some velocities. \ How should the velocities be chosen if you want to launch a wave in one \ direction only?\ \>", "Text", CellChangeTimes->{3.452444322078*^9}] }, Open ]], Cell[CellGroupData[{ Cell["Complex Functions", "Section", CellChangeTimes->{{3.452418634723*^9, 3.452418637301*^9}}], Cell["\<\ The second theme of the week is thinking about complex valued functions of a \ complex variable.\ \>", "Text", CellChangeTimes->{{3.452418644617*^9, 3.452418664928*^9}}], Cell[CellGroupData[{ Cell["BTM 6.1.5", "Subsection", CellChangeTimes->{{3.4524192921289997`*^9, 3.452419299784*^9}}], Cell["\<\ ... asks about analyticity and the Cauchy-Riemann equations. The starting idea is that in general a mapping of complex to complex does not \ have a good derivative, if by derivative you mean take the limit as \[Epsilon] goes to zero of (f[z+\ \[Epsilon]]-f[z])/\[Epsilon]. The hang up is that \[Epsilon] is now understood to be complex, implying there are at least two directions we can \ approach zero, real and imaginary, and these two will not agree in general. Try it out, writing in x,y coordinates: here is a random pair of functions: \ (feel free to change)\ \>", "Text", CellChangeTimes->{{3.452419302133*^9, 3.452419384406*^9}, {3.452419427365*^9, 3.4524194406359997`*^9}, {3.4524443457469997`*^9, 3.452444447685*^9}, { 3.452444485013*^9, 3.452444599712*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"u", "[", RowBox[{"x_", ",", "y_"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"x", "^", "2"}], " ", "-", "1"}]}]], "Input", CellChangeTimes->{{3.452419366665*^9, 3.452419402644*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"v", "[", RowBox[{"x_", ",", "y_"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"y", "^", "2"}], " ", "+", " ", "x"}]}]], "Input", CellChangeTimes->{{3.452419404568*^9, 3.452419409542*^9}, {3.452419449085*^9, 3.45241945354*^9}, {3.452419497123*^9, 3.452419497238*^9}}], Cell["Our complex valued function is:", "Text", CellChangeTimes->{{3.452419467918*^9, 3.452419475539*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "y_"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"u", "[", RowBox[{"x", ",", "y"}], "]"}], " ", "+", " ", RowBox[{"I", " ", RowBox[{"v", "[", RowBox[{"x", ",", "y"}], "]"}]}]}]}]], "Input", CellChangeTimes->{{3.4524194642130003`*^9, 3.452419492176*^9}}], Cell["Now take a derivative in the real direction:", "Text", CellChangeTimes->{{3.452419522597*^9, 3.452419532005*^9}}], Cell[BoxData[ RowBox[{"Limit", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"f", "[", RowBox[{ RowBox[{"x", "+", "\[Epsilon]"}], ",", "y"}], "]"}], "-", RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}]}], ")"}], "/", "\[Epsilon]"}], ",", RowBox[{"\[Epsilon]", "\[Rule]", "0"}]}], "]"}]], "Input", CellChangeTimes->{{3.4524195339309998`*^9, 3.452419594392*^9}}], Cell["And in the imaginary:", "Text", CellChangeTimes->{{3.452419598227*^9, 3.452419602777*^9}}], Cell[BoxData[ RowBox[{"Limit", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", RowBox[{"y", "+", "\[Epsilon]"}]}], "]"}], "-", RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{"I", " ", "\[Epsilon]"}], ")"}]}], ",", RowBox[{"\[Epsilon]", "\[Rule]", "0"}]}], "]"}]], "Input", CellChangeTimes->{{3.4524195339309998`*^9, 3.452419622557*^9}, 3.4524265451182423`*^9}], Cell["\<\ Your job: repeat for the u and v given in the problem, verifying that the \ real and imaginary parts of the derivatives agree, i.e. that the \ Cauchy-Riemann relations are obeyed.\ \>", "Text", CellChangeTimes->{{3.452419694165*^9, 3.4524197034110003`*^9}, { 3.452419737307*^9, 3.4524197529709997`*^9}, {3.4524446157799997`*^9, 3.452444649601*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"u", "[", RowBox[{"x_", ",", "y_"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"x", "^", "3"}], " ", "-", " ", RowBox[{"3", "x", " ", RowBox[{"y", "^", "2"}]}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"v", "[", RowBox[{"x_", ",", "y_"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"3", RowBox[{"x", "^", "2"}], "y"}], " ", "-", " ", RowBox[{"y", "^", "3"}]}]}]}], "Input", CellChangeTimes->{{3.452419756156*^9, 3.45241979191*^9}, { 3.452426551665243*^9, 3.452426552243379*^9}}], Cell["To visualize complex functions, here is a nifty package:", "Text", CellChangeTimes->{{3.452419839532*^9, 3.452419856317*^9}}], Cell[BoxData[ RowBox[{"Needs", "[", "\"\\"", "]"}]], "Code", CellChangeTimes->{{3.452279693113*^9, 3.452279698506*^9}, 3.452340367454*^9, {3.452419864995*^9, 3.452419865867*^9}}], Cell["which defines the following coloring of th ecomplex plane:", "Text", CellChangeTimes->{{3.452419869966*^9, 3.4524198787200003`*^9}}], Cell[BoxData[ RowBox[{"QComplexDensityPlot", "[", RowBox[{ RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input", CellChangeTimes->{3.452419894086*^9}], Cell["\<\ You give in any complex valued function expressed in terms of x and y, and \ f(x+iy) is plotted in color: the intensity encodes the magnitude and the phase is encoded in the color \ wheel (with red for real of course).\ \>", "Text", CellChangeTimes->{{3.4524199077200003`*^9, 3.452419974139*^9}}], Cell["\<\ Here is the function z^2, which has a double zero at z=0. Note how we swirl \ around the color wheel twice.\ \>", "Text", CellChangeTimes->{{3.452420005156*^9, 3.452420044166*^9}}], Cell[BoxData[ RowBox[{"QComplexDensityPlot", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}], "^", "2"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input", CellChangeTimes->{3.452443140408*^9}], Cell["\<\ And here is 1/z^3 which has a \"triple pole\" singularity at z=0. The wheel \ swirls three times the other way.\ \>", "Text", CellChangeTimes->{{3.452420023064*^9, 3.452420072021*^9}}], Cell[BoxData[ RowBox[{"QComplexDensityPlot", "[", RowBox[{ RowBox[{"1", "/", RowBox[{ RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}], "^", "3"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "\[Pi]"}], ",", "\[Pi]"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "\[Pi]"}], ",", "\[Pi]"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input", CellChangeTimes->{3.4524431384230003`*^9}], Cell["Some functions are polynomials, which have roots:", "Text", CellChangeTimes->{{3.4524201087679996`*^9, 3.452420126914*^9}}], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"z", "^", "4"}], "+", RowBox[{"z", "^", "2"}], "+", "1"}], "\[Equal]", "0"}], "}"}], "]"}]], "Input"], Cell["These zeroes show up as black dots in:", "Text", CellChangeTimes->{{3.452420176*^9, 3.452420187509*^9}}], Cell[BoxData[ RowBox[{"QComplexDensityPlot", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}], "^", "4"}], "+", RowBox[{ RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}], "^", "2"}], "+", "1"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input", CellChangeTimes->{{3.452420141742*^9, 3.4524201550299997`*^9}}], Cell["\<\ Or sometimes there are poles at the zeroes of some denominator:\ \>", "Text", CellChangeTimes->{{3.45242021056*^9, 3.452420225141*^9}}], Cell[BoxData[ RowBox[{"QComplexDensityPlot", "[", RowBox[{ RowBox[{"1", "/", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}], "^", "4"}], "+", RowBox[{ RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}], "^", "2"}], "+", "1"}], ")"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input", CellChangeTimes->{3.4524202322530003`*^9}], Cell["\<\ Your job: repeat for the functions of BTM 6.17: f(z) = 1/(1+z^4) and f(z) = \ 1/(z^4+2z^2+1). Also, you might plot the function of BTM 6.1.5 given above as u+Iv. Can you express the function \ in simple terms using z=x+Iy?\ \>", "Text", CellChangeTimes->{{3.452420243885*^9, 3.45242027313*^9}, { 3.4524266017912054`*^9, 3.452426668776867*^9}}], Cell["\<\ And by the way, not all functions are polynomials. Here is good old Sin and \ its zeroes.\ \>", "Text", CellChangeTimes->{{3.452420311218*^9, 3.452420346189*^9}}], Cell[BoxData[ RowBox[{"QComplexDensityPlot", "[", RowBox[{ RowBox[{"Sin", "[", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "\[Pi]"}], ",", "\[Pi]"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "\[Pi]"}], ",", "\[Pi]"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "300"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input", CellChangeTimes->{3.452420334574*^9}], Cell["\<\ Your job: prove that all the zeroes of sin lie on the real axis, i.e. there \ are no new funny ones out in the complex plane. Along the way, notice \ various relationships, such as Sin[i x] = i Sinh[x]\ \>", "Text", CellChangeTimes->{{3.452420493929*^9, 3.452420572644*^9}, {3.452420734043*^9, 3.452420767593*^9}}], Cell[BoxData[ RowBox[{"Sin", "[", " ", RowBox[{"I", " ", "x"}], "]"}]], "Input", CellChangeTimes->{{3.452420561494*^9, 3.452420568222*^9}, {3.452420718924*^9, 3.452420750546*^9}}], Cell[BoxData[ RowBox[{"Cosh", "[", RowBox[{"I", " ", "x"}], "]"}]], "Input", CellChangeTimes->{{3.4524207699300003`*^9, 3.4524207732869997`*^9}}], Cell["\<\ Next, visualize the n'th roots of unity, i.e. all the numbers z such that \ z^n=1. In particular, Plot f(z) = z^6-1 and look for the zeroes.\ \>", "Text", CellChangeTimes->{{3.452420833972*^9, 3.452420902565*^9}}], Cell["Then Solve for the zeros and add them up:", "Text", CellChangeTimes->{{3.452420905932*^9, 3.4524209287939997`*^9}}], Cell[BoxData[ RowBox[{"roots", "=", RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"z", "^", "6"}], "\[Equal]", "1"}], ",", "z"}], "]"}]}]], "Input",\ CellChangeTimes->{{3.452420930058*^9, 3.452420934848*^9}, {3.452420991743*^9, 3.4524209928450003`*^9}}], Cell["\<\ Your job on the paper homework: write these roots in polar and then x,y form \ before you add them up. But here ...\ \>", "Text", CellChangeTimes->{{3.452420956488*^9, 3.452420980579*^9}, {3.452421140802*^9, 3.452421190988*^9}}], Cell[BoxData[ RowBox[{"zlist", " ", "=", " ", RowBox[{"z", "/.", "roots"}]}]], "Input", CellChangeTimes->{{3.452420995476*^9, 3.452421005406*^9}}], Cell[BoxData[ RowBox[{"Total", "[", "zlist", "]"}]], "Input", CellChangeTimes->{{3.4524210077939997`*^9, 3.452421057547*^9}, { 3.4524211282609997`*^9, 3.452421129538*^9}}], Cell[TextData[{ "Next find the roots of Exp[z]+2 (from BTM 6.2.12).\n", StyleBox["Mathematica", FontSlant->"Italic"], " can find at least one possibility:" }], "Text", CellChangeTimes->{{3.4524212085959997`*^9, 3.4524212421940002`*^9}}], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Exp", "[", "z", "]"}], "+", "2"}], "\[Equal]", "0"}], ",", "z"}], "]"}]], "Input", CellChangeTimes->{{3.4524211921029997`*^9, 3.452421200844*^9}}], Cell["\<\ But are there others? I.e. QPlot the function Exp[z]+2 and look for any black \ dots.\ \>", "Text", CellChangeTimes->{{3.452421247667*^9, 3.452421249962*^9}, {3.452443200274*^9, 3.4524432410369997`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["BTM 6.2.14", "Subsection", CellChangeTimes->{{3.4524213186219997`*^9, 3.4524213217980003`*^9}}], Cell["\<\ Here is a random 4th degree polynomial with 4 roots (two conjugate pairs)\ \>", "Text", CellChangeTimes->{{3.452421349561*^9, 3.452421363167*^9}, { 3.4524216285550003`*^9, 3.452421638035*^9}}], Cell[BoxData[ RowBox[{"q", " ", "=", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"z", "^", "4"}], " ", "+", " ", RowBox[{"2", RowBox[{"z", "^", "3"}]}], " ", "-", "z", " ", "+", "1"}], " ", "/.", " ", RowBox[{"z", "\[Rule]", RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}]}]}], ")"}]}]], "Input", CellChangeTimes->{{3.452421372467*^9, 3.452421397626*^9}, {3.452421477775*^9, 3.452421486951*^9}}], Cell[BoxData[ RowBox[{"QComplexDensityPlot", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}], "^", "4"}], " ", "-", " ", RowBox[{"(", RowBox[{"x", "+", RowBox[{"I", " ", "y"}]}], ")"}], " ", "+", "1"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input", CellChangeTimes->{{3.452420141742*^9, 3.4524201550299997`*^9}, { 3.452421403172*^9, 3.452421406028*^9}, {3.452421461216*^9, 3.4524214627679996`*^9}, 3.452421493927*^9, {3.4524215494630003`*^9, 3.452421616024*^9}}], Cell["\<\ BTM 6.2.14 asks about these polynomials: f(z) = z^4 + 2z^2 + 1 and f(z) = z^6 \ + 2 z^3 + 1. How many roots do these ones have? And are they simple zeroes, or perhaps \ double zeroes? How can you tell from the QPlot?\ \>", "Text", CellChangeTimes->{{3.4524212671549997`*^9, 3.452421303072*^9}, { 3.4524216456029997`*^9, 3.45242171129*^9}, 3.45244318055*^9}] }, Open ]] }, Open ]] }, Open ]] }, AutoGeneratedPackage->None, ScreenStyleEnvironment->"Presentation", WindowSize->{1005, 732}, WindowMargins->{{-2, Automatic}, {Automatic, -12}}, ShowSelection->True, Magnification->1.25, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (May 21, 2008)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 116, 1, 77, "Subtitle"], Cell[709, 26, 183, 4, 47, "Text"], Cell[CellGroupData[{ Cell[917, 34, 28, 0, 95, "Section"], Cell[948, 36, 118, 1, 47, "Text"], Cell[1069, 39, 168, 4, 47, "Text"], Cell[1240, 45, 169, 5, 45, "Input"], Cell[1412, 52, 178, 4, 45, "Input"], Cell[1593, 58, 225, 5, 45, "Input"], Cell[1821, 65, 55, 0, 47, "Text"], Cell[1879, 67, 304, 9, 45, "Input"], Cell[2186, 78, 56, 0, 47, "Text"], Cell[2245, 80, 333, 11, 45, "Input"], Cell[2581, 93, 48, 0, 47, "Text"], Cell[2632, 95, 374, 12, 45, "Input"], Cell[3009, 109, 262, 6, 45, "Input"], Cell[3274, 117, 154, 3, 45, "Input"], Cell[3431, 122, 116, 1, 47, "Text"], Cell[3550, 125, 371, 12, 45, "Input"], Cell[3924, 139, 91, 1, 47, "Text"], Cell[4018, 142, 662, 18, 45, "Input"], Cell[4683, 162, 376, 6, 76, "Text"], Cell[5062, 170, 187, 5, 45, "Input"], Cell[5252, 177, 187, 5, 45, "Input"], Cell[5442, 184, 243, 5, 47, "Text"], Cell[5688, 191, 251, 8, 45, "Input"], Cell[5942, 201, 362, 6, 104, "Text"], Cell[6307, 209, 281, 7, 45, "Input"], Cell[6591, 218, 107, 1, 47, "Text"], Cell[6701, 221, 351, 11, 45, "Input"], Cell[7055, 234, 267, 6, 45, "Input"], Cell[7325, 242, 416, 12, 45, "Input"], Cell[7744, 256, 431, 9, 104, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[8212, 270, 94, 1, 95, "Section"], Cell[8309, 273, 424, 8, 104, "Text"], Cell[8736, 283, 55, 0, 47, "Text"], Cell[8794, 285, 461, 15, 45, "Input"], Cell[9258, 302, 168, 5, 45, "Input"], Cell[9429, 309, 52, 0, 47, "Text"], Cell[9484, 311, 251, 6, 45, "Input"], Cell[9738, 319, 266, 5, 76, "Text"], Cell[10007, 326, 230, 7, 45, "Input"], Cell[10240, 335, 116, 1, 47, "Text"], Cell[10359, 338, 323, 10, 45, "Input"], Cell[10685, 350, 117, 1, 47, "Text"], Cell[10805, 353, 229, 7, 45, "Input"], Cell[11037, 362, 109, 1, 47, "Text"], Cell[11149, 365, 348, 11, 45, "Input"], Cell[11500, 378, 278, 9, 45, "Input"], Cell[11781, 389, 201, 4, 47, "Text"], Cell[11985, 395, 438, 13, 45, "Input"], Cell[12426, 410, 127, 1, 47, "Text"], Cell[12556, 413, 94, 2, 45, "Input"], Cell[12653, 417, 91, 1, 47, "Text"], Cell[12747, 420, 443, 14, 45, "Input"], Cell[13193, 436, 104, 1, 47, "Text"], Cell[13300, 439, 657, 19, 75, "Input"], Cell[13960, 460, 199, 4, 47, "Text"], Cell[14162, 466, 595, 18, 75, "Input"], Cell[14760, 486, 129, 2, 45, "Input"], Cell[14892, 490, 884, 15, 189, "Text"], Cell[15779, 507, 601, 19, 45, "Input"], Cell[16383, 528, 232, 6, 45, "Input"], Cell[16618, 536, 231, 5, 76, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[16886, 546, 96, 1, 95, "Section"], Cell[16985, 549, 180, 4, 47, "Text"], Cell[CellGroupData[{ Cell[17190, 557, 96, 1, 86, "Subsection"], Cell[17289, 560, 786, 14, 189, "Text"], Cell[18078, 576, 225, 6, 45, "Input"], Cell[18306, 584, 312, 7, 45, "Input"], Cell[18621, 593, 107, 1, 47, "Text"], Cell[18731, 596, 345, 10, 45, "Input"], Cell[19079, 608, 120, 1, 47, "Text"], Cell[19202, 611, 427, 12, 45, "Input"], Cell[19632, 625, 97, 1, 47, "Text"], Cell[19732, 628, 506, 15, 45, "Input"], Cell[20241, 645, 364, 7, 76, "Text"], Cell[20608, 654, 554, 16, 75, "Input"], Cell[21165, 672, 132, 1, 47, "Text"], Cell[21300, 675, 191, 3, 65, "Code"], Cell[21494, 680, 139, 1, 47, "Text"], Cell[21636, 683, 451, 13, 75, "Input"], Cell[22090, 698, 307, 6, 76, "Text"], Cell[22400, 706, 192, 4, 47, "Text"], Cell[22595, 712, 504, 15, 75, "Input"], Cell[23102, 729, 196, 4, 47, "Text"], Cell[23301, 735, 553, 16, 75, "Input"], Cell[23857, 753, 130, 1, 47, "Text"], Cell[23990, 756, 202, 7, 45, "Input"], Cell[24195, 765, 111, 1, 47, "Text"], Cell[24309, 768, 674, 20, 75, "Input"], Cell[24986, 790, 146, 3, 47, "Text"], Cell[25135, 795, 724, 23, 75, "Input"], Cell[25862, 820, 358, 7, 76, "Text"], Cell[26223, 829, 174, 4, 47, "Text"], Cell[26400, 835, 500, 14, 75, "Input"], Cell[26903, 851, 329, 6, 76, "Text"], Cell[27235, 859, 187, 4, 45, "Input"], Cell[27425, 865, 150, 3, 45, "Input"], Cell[27578, 870, 224, 5, 76, "Text"], Cell[27805, 877, 122, 1, 47, "Text"], Cell[27930, 880, 277, 8, 45, "Input"], Cell[28210, 890, 242, 6, 76, "Text"], Cell[28455, 898, 151, 3, 45, "Input"], Cell[28609, 903, 175, 3, 45, "Input"], Cell[28787, 908, 242, 6, 76, "Text"], Cell[29032, 916, 239, 7, 45, "Input"], Cell[29274, 925, 217, 5, 47, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[29528, 935, 102, 1, 86, "Subsection"], Cell[29633, 938, 205, 4, 47, "Text"], Cell[29841, 944, 476, 14, 45, "Input"], Cell[30320, 960, 822, 22, 75, "Input"], Cell[31145, 984, 372, 8, 104, "Text"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)