(* Content-type: application/mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 7.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 145, 7]
NotebookDataLength[ 20157, 627]
NotebookOptionsPosition[ 18207, 561]
NotebookOutlinePosition[ 19085, 590]
CellTagsIndexPosition[ 19042, 587]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[TextData[{
StyleBox["Learning ",
FontSize->16,
FontWeight->"Bold",
FontVariations->{"CompatibilityType"->"Subscript"}],
StyleBox["Mathematica",
FontSize->16,
FontWeight->"Bold",
FontSlant->"Italic",
FontVariations->{"CompatibilityType"->"Subscript"}],
StyleBox[" Basics\n",
FontSize->16,
FontWeight->"Bold",
FontVariations->{"CompatibilityType"->"Subscript"}],
StyleBox["Calculus Operations II",
FontWeight->"Bold",
FontVariations->{"CompatibilityType"->"Subscript"}]
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{
3.459090235989132*^9, {3.459096883085207*^9, 3.459096887484048*^9},
3.459105326077903*^9},
TextAlignment->Center,
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"Solve each of the following problems using ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" exclusively."
}], "Text",
Editable->False,
Evaluatable->False,
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"1. In the last notebook we considered ",
StyleBox["differential",
FontSlant->"Italic"],
" operations in ",
StyleBox["Mathematica",
FontSlant->"Italic"],
". We now move on to look at ",
StyleBox["integral",
FontSlant->"Italic"],
" operations and ",
StyleBox["series",
FontSlant->"Italic"],
" generation. First we'll consider the most basic integration command: ask \
",
StyleBox["Mathematica",
FontSlant->"Italic"],
" for the syntax of ",
StyleBox["Integrate",
FontFamily->"Courier",
FontWeight->"Bold"],
"."
}], "Text",
Editable->False,
Evaluatable->False,
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"2. Looks like it comes in several flavors! First the most basic, the \
indefinite integral. To integrate ",
Cell[BoxData[
FormBox[
SuperscriptBox["x", "4"], TraditionalForm]]],
" the command would be simply ",
StyleBox["Integrate[x^4,x]",
FontFamily->"Courier",
FontWeight->"Bold"],
". But instead, go ahead and integrate the function ",
Cell[BoxData[
FormBox[
RowBox[{"x", " ", "sin", " ", "x"}], TraditionalForm]]],
". (Don't forget to change it into ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" format first.)"
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459105600002902*^9, 3.459105640041918*^9}, {
3.459106131261566*^9, 3.459106132313531*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"3. The previous integral required integration by parts, so it would \
appear that ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" can handle at least one step beyond basic integration. Now you're \
probably wondering why it is necessary to tell ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" what variable we intend to integrate with respect to. After all, \
shouldn't it be obvious? Actually, no! The integrand you are working with \
may involve other variables (or parameters.) Say, for example, you wanted to \
integrate the generalized quadratic function ",
Cell[BoxData[
FormBox[
RowBox[{
RowBox[{"a", " ",
SuperscriptBox["x", "2"]}], " ", "+", " ",
RowBox[{"b", " ", "x"}], " ", "+", " ", "c"}], TraditionalForm]]],
". It would be possible for the integral to be taken with respect to any of \
",
StyleBox["a, b, c, ",
FontSlant->"Italic"],
"or ",
StyleBox["x",
FontSlant->"Italic"],
". In fact go ahead and do the integral all four ways in the order stated."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.4591058577598753`*^9, 3.459105864646941*^9}, {
3.459105918649509*^9, 3.459105921382184*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"4. Notice how many ways the ",
StyleBox["same",
FontSlant->"Italic"],
" function can be integrated. Clearly it is important to be able to \
instruct ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" which variable to integrate with respect to. (By the way, you will often \
notice similar syntax requirements for other commands in ",
StyleBox["Mathematica",
FontSlant->"Italic"],
", i.e. the need to specify which part of an expression to treat as ",
StyleBox["the",
FontSlant->"Italic"],
" variable. If ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" is to retain the ability to handle generalized expressions as in the \
previous example then it must provide a place for the variable to be \
specified.)\n\nLet's now try a ",
StyleBox["definite",
FontWeight->"Bold",
FontSlant->"Italic"],
" integral. Check back for the syntax in problem 1 if necessary, and \
integrate ",
Cell[BoxData[
FormBox[
RowBox[{
SuperscriptBox["x", "3"], " ",
SuperscriptBox["e", "x"]}], TraditionalForm]]],
" from 0 to 3."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459105970268847*^9, 3.459105984180686*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"5. Observe that the answer we got to the previous problem was ",
StyleBox["exact",
FontWeight->"Bold"],
". i.e. ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" didn't \"cheat\" and use some numerical technique to produce a decimal \
approximation to this integral. Rather, it actually calculated an \
antiderivative of the function and substituted in the limits.\n\nOK, so far \
we've teased ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" with a couple of problems requiring integration by parts. Let's hit it \
with a few more sophisticated indefinite integrals.\n\na) Integrate ",
Cell[BoxData[
FormBox[
RowBox[{" ",
StyleBox[
FractionBox["1",
RowBox[{
SuperscriptBox["x", "2"], " ", "+", " ",
RowBox[{"6", "x"}], " ", "+", " ", "13"}]],
FontSize->14], " "}], TraditionalForm]]],
" (which requires completing the square and trigonometric substitution when \
done \"by hand\".)"
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459106011803444*^9, 3.4591060122114887`*^9}, {
3.459106294502639*^9, 3.459106334479967*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"b) Integrate ",
Cell[BoxData[
FormBox[
StyleBox[
FractionBox["1",
RowBox[{
RowBox[{"3",
SuperscriptBox["x", "4"]}], " ", "-", " ",
RowBox[{"2",
SuperscriptBox["x", "3"]}], " ", "+", " ",
RowBox[{"18",
SuperscriptBox["x", "2"]}], " ", "-", " ",
RowBox[{"12", "x"}]}]],
FontSize->14], TraditionalForm]]],
" (which requires partial fractions and substitution when done \"by hand\".)"
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459106407947955*^9, 3.459106451621035*^9}, {
3.4591064983623323`*^9, 3.45910649840306*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"c) Integrate ",
Cell[BoxData[
FormBox[
SqrtBox[
RowBox[{
SuperscriptBox["x", "2"], "+",
RowBox[{"4", "x"}], "+", "3"}]], TraditionalForm]]],
" (which requires some pretty fancy substitutions when done \"by hand\".)"
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.4591065748420353`*^9, 3.459106629825433*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"d) Integrate ",
Cell[BoxData[
FormBox[
RowBox[{"sin", "(",
FractionBox["1",
RowBox[{
SuperscriptBox["x", "2"], "+", "1"}]], ")"}], TraditionalForm]],
FontSize->14],
" (which requires goodness knows what when done \"by hand\".)"
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.4591067096267157`*^9, 3.459106730580451*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"6. That last one did not finish successfully. ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" simply restated the problem. You should be aware by this point in your \
mathematical career that given an integral at random, it will almost \
certainly be impossible to do by hand (symbolically). ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" is no better at these than we are. Such \"impossible\" integrals are \
usually treated numerically, or through the use of infinite series depending \
on whether the integral is definite or indefinite.\n\nLet's consider the \
previous integral again, this time giving it some limits, a lower limit of 0 \
and an upper limit of 2. Now ",
StyleBox["don't",
FontWeight->"Bold"],
" dive straight in and use ",
StyleBox["Integrate",
FontFamily->"Courier",
FontWeight->"Bold"],
". That would result in the same problem we just had in part d) above when ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" tried for an antiderivative. i.e. it would never get as far as \
substituting in the limits. Instead the command we need is ",
StyleBox["NIntegrate",
FontFamily->"Courier",
FontWeight->"Bold"],
". Apart from it's name, the syntax of this command is identical to ",
StyleBox["Integrate",
FontFamily->"Courier",
FontWeight->"Bold"],
" on definite integrals. Go ahead and use it on the previous problem with \
the given limits."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.4591060287767572`*^9, 3.45910602886127*^9}, {
3.459106774466223*^9, 3.45910677517638*^9}, {3.459107020973277*^9,
3.4591070367331057`*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"7. You should have gotten about 1.01313. Do not confuse ",
StyleBox["NIntegrate[...]",
FontFamily->"Courier",
FontWeight->"Bold"],
" with ",
StyleBox["N[Integrate[...]]",
FontFamily->"Courier",
FontWeight->"Bold"],
". The first of these does the problem numerically from the start using an \
adaptive version of Simpson's rule, whereas the second attempts to do the \
problem symbolically, then produces the decimal of this answer. Because of \
its speed and accuracy ",
StyleBox["NIntegrate",
FontFamily->"Courier",
FontWeight->"Bold"],
" is often used even when ",
StyleBox["Integrate",
FontFamily->"Courier",
FontWeight->"Bold"],
" would work.\n\nLet's move on to the construction of the ",
StyleBox["series expansion",
FontWeight->"Bold"],
" of a function. Ask ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" for the syntax of ",
StyleBox["Series",
FontFamily->"Courier",
FontWeight->"Bold"],
"."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.4591071561939783`*^9, 3.459107189148177*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"8. So to generate a series expansion of ",
Cell[BoxData[
FormBox[
RowBox[{"sin", " ", "x"}], TraditionalForm]]],
" centered at 0, (i.e. a Maclaurin series) going out as far as the 9th \
degree term, the command would be: ",
StyleBox["Series[Sin[x],{x,0,9}]",
FontFamily->"Courier",
FontWeight->"Bold"],
". Go ahead and issue this command to see how it works, and read the result \
into a variable called ",
StyleBox["sinseries",
FontFamily->"Courier",
FontWeight->"Bold"],
"."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.4591072355990973`*^9, 3.459107248336277*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"9. Look carefully at the result. Observe that the last term has a \
somewhat strange appearance. This is referred to as \"big Oh\" notation. \
What it means is that the actual series goes on forever, but that all of the \
remaining terms are of order ",
Cell[BoxData[
FormBox[
SuperscriptBox["x", "10"], TraditionalForm]]],
" or greater. Unfortunately this term, despite being strictly \
mathematically correct, can be an inconvenience when it comes to actually \
using the series in further calculations. Thankfully ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" provides a way of stripping away this term, the ",
StyleBox["Normal",
FontFamily->"Courier",
FontWeight->"Bold"],
" command. Go ahead and wrap a ",
StyleBox["Normal",
FontFamily->"Courier",
FontWeight->"Bold"],
" command around ",
StyleBox["sinseries",
FontFamily->"Courier",
FontWeight->"Bold"],
" to see the \"big Oh\" term disappear. Oh, and read the answer back into \
",
StyleBox["sinseries",
FontFamily->"Courier",
FontWeight->"Bold"],
" again."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459106040748375*^9, 3.459106040809143*^9}, {
3.4591081718979893`*^9, 3.459108179265875*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"10. To get a feel for how well the series approximates the actual \
function, let's plot them both on the same graph using the ",
StyleBox["Plot",
FontFamily->"Courier",
FontWeight->"Bold"],
" command. We'll also give them different colors so that we can tell the \
two apart. Since we didn't yet learn the graphing features of ",
StyleBox["Mathematica",
FontSlant->"Italic"],
", I'll give you the necessary input. The command would be:\n\n",
StyleBox["Plot[{sinseries,Sin[x]},{x,-2Pi,2Pi}]",
FontFamily->"Courier",
FontWeight->"Bold"],
"\n\t \nGo ahead and issue it."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459108227466175*^9, 3.459108320613235*^9}, {
3.459108358672418*^9, 3.459108366357802*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"11. Now it's your turn. Create a similar graph for the function ",
Cell[BoxData[
FormBox[
SuperscriptBox["e", "x"], TraditionalForm]]],
". Center it at 0, a Maclaurin series, and generate terms up to the sixth \
degree. Plot your graph on the interval",
Cell[BoxData[
FormBox[
RowBox[{" ",
RowBox[{
RowBox[{"-", "5"}], "\[LessSlantEqual]", "x", "\[LessSlantEqual]",
"7"}]}], TraditionalForm]]],
". You can use ",
StyleBox["eseries",
FontFamily->"Courier",
FontWeight->"Bold"],
" as the name for your series approximation."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459106048706551*^9, 3.459106080199234*^9}, {
3.4591084493568687`*^9, 3.4591084604429827`*^9}, {3.4591085129428587`*^9,
3.4591085209938307`*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"12. To finish, let's consider the problem of finding the antiderivative of \
a \"nasty\" function. Consider ",
Cell[BoxData[
FormBox[
RowBox[{"sin", "(",
SuperscriptBox["x", "2"], ")"}], TraditionalForm]]],
" for example. You were probably told in your calculus course that such an \
integral is considered impossible symbolically. In fact go ahead and ask ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" to integrate this function directly."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459108607572115*^9, 3.459108614892139*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"13. Surprisingly we got an answer. Well, maybe not so surprisingly if \
you've studied any optics in your physics courses. This particular integral \
actually shows up often enough in this field to have been given a name, the \
Fresnel Sine Function. The other \"junk\" in our output are purely scaling \
constants. The Fresnel Sine Function is just a fancy name, however, for a \
function which cannot be expressed in terms of the elementary functions we \
are used to. ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" even has the values of this function \"memorized\" as it does with the \
logarithmic functions, etc. But that's beside the point. Let's consider a \
\"sneaky\" approach to symbolically integrating this function.\n\nGenerate \
the series expansion of ",
Cell[BoxData[
FormBox[
RowBox[{"sin", "(",
SuperscriptBox["x", "2"], ")"}], TraditionalForm]]],
" centered at 0 out to the 20th order term, and read the result into a \
variable called ",
StyleBox["fresnelseries",
FontFamily->"Courier",
FontWeight->"Bold"],
"."
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.459106093081396*^9, 3.459106093151207*^9},
3.4591087361375303`*^9},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"14. ",
StyleBox["Now",
FontSlant->"Italic"],
" you can apply the basic ",
StyleBox["Integrate",
FontFamily->"Courier",
FontWeight->"Bold"],
" command to ",
StyleBox["fresnelseries",
FontFamily->"Courier",
FontWeight->"Bold"],
"."
}], "Text",
Editable->False,
Evaluatable->False,
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]],
Cell[TextData[{
"15. You should have produced a series with a 22nd order \"big Oh\" term on \
the end. This series represents the series expansion of the antiderivative \
we originally set out to find. Apparently, then, we can get a series version \
of the antiderivative even when we can't evaluate the antiderivative \
directly.\n\nFor the sake of comparison, ask for the series expansion of the ",
StyleBox["answer",
FontSlant->"Italic"],
" to problem 12. (Yes, it will take a lot of typing, or you can copy and \
paste the entire output cell.) Center it at 0 and go out to the 21st degree \
term. You should get the same answer as you got in problem 14. (Which is \
what you expected I hope.)"
}], "Text",
Editable->False,
Evaluatable->False,
CellChangeTimes->{{3.4591061033244057`*^9, 3.459106103384211*^9}, {
3.459108884668558*^9, 3.45910888517601*^9}, {3.4591089410014544`*^9,
3.4591089413139477`*^9}},
AspectRatioFixed->True,
Background->RGBColor[0.9, 1, 1]]
},
WindowToolbars->{},
CellGrouping->Manual,
WindowSize->{651, 968},
WindowMargins->{{43, Automatic}, {Automatic, 0}},
ShowSelection->True,
ShowCellLabel->True,
ShowCellTags->False,
FrontEndVersion->"11.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (September \
21, 2016)",
StyleDefinitions->"Default.nb",
PrivateNotebookOptions -> {"ColorPalette" -> {RGBColor, 128}},
RenderingOptions -> {"ObjectDithering" -> True},
RenderingOptions -> {"RasterDithering" -> False},
MacintoshSystemPageSetup -> \
"00<0001804P000000]P2:?oQon82n@960dL5:0?l0080001804P000000]P2:001\n\
0000I00000400`<300000BL?00400@0000000000000006P801T1T00000000000\n\
00000000000000000000000000000000",
CharacterEncoding -> "MacintoshAutomaticEncoding"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[545, 20, 751, 25, 88, "Text",
Evaluatable->False],
Cell[1299, 47, 239, 9, 46, "Text",
Evaluatable->False],
Cell[1541, 58, 664, 26, 85, "Text",
Evaluatable->False],
Cell[2208, 86, 792, 24, 106, "Text",
Evaluatable->False],
Cell[3003, 112, 1264, 33, 180, "Text",
Evaluatable->False],
Cell[4270, 147, 1247, 37, 199, "Text",
Evaluatable->False],
Cell[5520, 186, 1192, 32, 227, "Text",
Evaluatable->False],
Cell[6715, 220, 698, 22, 75, "Text",
Evaluatable->False],
Cell[7416, 244, 434, 14, 76, "Text",
Evaluatable->False],
Cell[7853, 260, 450, 15, 57, "Text",
Evaluatable->False],
Cell[8306, 277, 1707, 41, 207, "Text",
Evaluatable->False],
Cell[10016, 320, 1143, 36, 147, "Text",
Evaluatable->False],
Cell[11162, 358, 695, 21, 72, "Text",
Evaluatable->False],
Cell[11860, 381, 1308, 37, 135, "Text",
Evaluatable->False],
Cell[13171, 420, 842, 21, 147, "Text",
Evaluatable->False],
Cell[14016, 443, 864, 25, 72, "Text",
Evaluatable->False],
Cell[14883, 470, 659, 17, 78, "Text",
Evaluatable->False],
Cell[15545, 489, 1289, 30, 183, "Text",
Evaluatable->False],
Cell[16837, 521, 375, 17, 42, "Text",
Evaluatable->False],
Cell[17215, 540, 988, 19, 132, "Text",
Evaluatable->False]
}
]
*)