use quarto, not Pluto to render pages

This commit is contained in:
jverzani committed 2022-07-24 16:38:24 -04:00
1 parent 93c993206a
commit 7b37ca828c
879 files changed
+793311 -2678

No files matched your search

@@ -0,0 +1,15 @@
{
"hash": "ec82cdb14cca769cc4d3ee7665fead87",
"result": {
"markdown": "# Substitution\n\n\n\nThis section uses these add-on packages:\n\n``` {.julia .cell-code}\nusing CalculusWithJulia\nusing Plots\nusing SymPy\n```\n\n\n\n\n---\n\n\nThe technique of $u$-[substitution](https://en.wikipedia.org/wiki/Integration_by_substitution) is derived from reversing the chain rule: $[f(g(x))]' = f'(g(x)) g'(x)$.\n\n\nSuppose that $g$ is continuous and $u(x)$ is differentiable with $u'(x)$ being Riemann integrable. Then both these integrals are defined:\n\n\n\n$$\n\\int_a^b g(u(t)) \\cdot u'(t) dt, \\quad \\text{and}\\quad \\int_{u(a)}^{u(b)} g(x) dx.\n$$\n\n\nWe wish to show they are equal.\n\n\nLet $G$ be an antiderivative of $g$, which exists as $g$ is assumed to be continuous. (By the Fundamental Theorem part I.) Consider the composition $G \\circ u$. The chain rule gives:\n\n\n\n$$\n[G \\circ u]'(t) = G'(u(t)) \\cdot u'(t) = g(u(t)) \\cdot u'(t).\n$$\n\n\nSo,\n\n\n\n$$\n\\begin{align*}\n\\int_a^b g(u(t)) \\cdot u'(t) dt &= \\int_a^b (G \\circ u)'(t) dt\\\\\n&= (G\\circ u)(b) - (G\\circ u)(a) \\quad\\text{(the FTC, part II)}\\\\\n&= G(u(b)) - G(u(a)) \\\\\n&= \\int_{u(a)}^{u(b)} g(x) dx. \\quad\\text{(the FTC part II)}\n\\end{align*}\n$$\n\n\nThat is, this substitution formula applies:\n\n\n> $\\int_a^b g(u(x)) u'(x) dx = \\int_{u(a)}^{u(b)} g(x) dx.$\n\n\n\nFurther, for indefinite integrals,\n\n\n> $\\int f(g(x)) g'(x) dx = \\int f(u) du.$\n\n\n\nWe have seen a special case of substitution where $u(x) = x-c$ in the formula $\\int_{a-c}^{b-c} g(x) dx= \\int_a^b g(x-c)dx$.\n\n\nThe main use of this is to take complicated things inside of the function $g$ out of the function (the $u(x)$) by renaming them, then accounting for the change of name.\n\n\nSome examples are in order.\n\n\nConsider:\n\n\n\n$$\n\\int_0^{\\pi/2} \\cos(x) e^{\\sin(x)} dx.\n$$\n\n\nClearly the $\\sin(x)$ inside the exponential is an issue. If we let $u(x) = \\sin(x)$, then $u'(x) = \\cos(x)$, and this becomes\n\n\n\n$$\n\\int_0^2 u\\prime(x) e^{u(x)} dx =\n\\int_{u(0)}^{u(\\pi/2)} e^x dx = e^x \\big|_{\\sin(0)}^{\\sin(\\pi/2)} = e^1 - e^0.\n$$\n\n\nThis all worked, as the problem was such that it was more or less obvious what to choose for $u$ and $G$.\n\n\n### Integration by substitution\n\n\nThe process of identifying the result of the chain rule in the function to integrate is not automatic, but rather a bit of an art. The basic step is to try some values and hope one works. Typically, this is taught by \"substituting\" in some value for part of the expression (basically the $u(x)$) and seeing what happens.\n\n\nIn the above problem, $\\int_0^{\\pi/2} \\cos(x) e^{\\sin(x)} dx$, we might just rename $\\sin(x)$ to be $u$ (suppressing the \"of $x$ part). Then we need to rewrite the \"$dx$\" part of the integral. We know in this case that $du/dx = \\cos(x)$. In terms of differentials, this gives $du = \\cos(x) dx$. But this allows us to substitute in with $u$ and $du$ as is possible:\n\n\n\n$$\n\\int_0^{\\pi/2} \\cos(x) e^{\\sin(x)} dx = \\int_0^{\\pi/2} e^{\\sin(x)} \\cdot \\cos(x) dx = \\int_{u(0)}^{u(\\pi)} e^u du.\n$$\n\n\n---\n\nLet's illustrate with a new problem: $\\int_0^2 4x e^{x^2} dx$.\n\n\nAgain, we see that the $x^2$ inside the exponential is a complication. Letting $u = x^2$ we have $du = 2x dx$. We have $4xdx$ in the original problem, so we will end up with $2du$:\n\n\n\n$$\n\\int_0^2 4x e^{x^2} dx = 2\\int_0^2 e^{x^2} \\cdot 2x dx = 2\\int_{u(0)}^{u(2)} e^u du = 2 \\int_0^4 e^u du =\n2 e^u\\big|_{u=0}^4 = 2(e^4 - 1).\n$$\n\n---\n\n\nConsider now $\\int_0^1 2x^2 \\sqrt{1 + x^3} dx$. Here we see that the $1 + x^3$ makes the square root term complicated. If we call this $u$, then what is $du$? Clearly, $du = 3x^2 dx$, or $(1/3)du = x^2 dx$, so we can rewrite this as:\n\n\n\n$$\n\\int_0^1 2x^2 \\sqrt{1 + x^3} dx = \\int_{u(0)}^{u(1)} 2 \\sqrt{u} (1/3) du = 2/3 \\cdot \\frac{u^{3/2}}{3/2} \\big|_1^2 =\n\\frac{4}{9} \\cdot(2^{3/2} - 1).\n$$\n\n\n---\n\nConsider $\\int_0^{\\pi} \\cos(x)^3 \\sin(x) dx$. The $\\cos(x)$ function inside the $x^3$ function is complicated. We let $u(x) = \\cos(x)$ and see what that implies: $du = \\sin(x) dx$, which we see is part of the question. So the above becomes:\n\n\n\n$$\n\\int_0^{\\pi} \\cos(x)^3 \\sin(x) dx = \\int_{u(0)}^{u(\\pi)} u^3 du= \\frac{u^4}{4}\\big|_0^0 = 0.\n$$\n\n\nChanging limits leaves the two endpoints the same, which means the total area after substitution is $0$. A graph of this function shows that about $\\pi/2$ the function has odd-like symmetry, so the answer of $0$ is supported by the plot:\n\n::: {.cell hold='true' execution_count=4}\n``` {.julia .cell-code}\nf(x) = cos(x)^3 * sin(x)\nplot(f, 0, 1pi)\n```\n\n::: {.cell-output .cell-output-display execution_count=5}\n![](substitution_files/figure-html/cell-5-output-1.svg){}\n:::\n:::\n\n\n---\n\n\nConsider $\\int_1^e \\log(x)/x dx$. There isn't really an \"inside\" function here, but instead just a tricky $\\log(x)$. If we let $u=\\log(x)$, what happens? We get $du = 1/x \\cdot dxLine truncated
"supporting": [
"substitution_files"
],
"filters": [],
"includes": {
"include-in-header": [
"<script src=\"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\" integrity=\"sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==\" crossorigin=\"anonymous\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js\" integrity=\"sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==\" crossorigin=\"anonymous\"></script>\n<script type=\"application/javascript\">define('jquery', [],function() {return window.jQuery;})</script>\n"
]
}
}
}