15 lines
66 KiB
JSON
15 lines
66 KiB
JSON
{
|
||
"hash": "1b40c587619ebd1a5d4298b7c34babc7",
|
||
"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{}\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 dx$, which we see present in the original. So with this, we have:\n\n\n\n$$\n\\int_1^e \\frac{\\log(x)}{x} dx = \\int_{u(1)}^{u(e)} u du = \\frac{u^2}{2}\\big|_0^1 = \\frac{1}{2}.\n$$\n\n\n##### Example: Transformations\n\n\nWe say that the area intrinsically discussed in the definite integral $A=\\int_a^b f(x-c) dx$ is unaffected by shifts, in that $A = \\int_{a-c}^{b-c} f(x) dx$. What about more general transformations? For example: if $g(x) = (1/h) \\cdot f((x-c)/h)$ for values $c$ and $h$ what is the integral over $a$ to $b$ in terms of the function $f(x)$?\n\n\nIf $A = \\int_a^b (1/h) \\cdot f((x-c)/h) dx$ then we let $u = (x-c)/h$. With this, $du = 1/h \\cdot dx$. This allows a straight substitution:\n\n\n\n$$\nA = \\int_a^b \\frac{1}{h} f(\\frac{x-c}{h}) dx = \\int_{(a-c)/h}^{(b-c)/h} f(u) du.\n$$\n\n\nSo the answer is: the area under the transformed function over $a$ to $b$ is the area of the function over the transformed region.\n\n\nFor example, consider the \"hat\" function $f(x) = 1 - \\lvert x \\rvert $ when $-1 \\leq x \\leq 1$ and $0$ otherwise. The area under $f$ is just $1$ - the graph forms a triangle with base of length $2$ and height $1$. If we take any values of $c$ and $h$, what do we find for the area under the curve of the transformed function?\n\n\nLet $u(x) = (x-c)/h$ and $g(x) = h f(u(x))$. Then, as $du = 1/h dx$\n\n\n\n$$\n\\begin{align}\n\\int_{c-h}^{c+h} g(x) dx\n&= \\int_{c-h}^{c+h} h f(u(x)) dx\\\\\n&= \\int_{u(c-h)}^{u(c+h)} f(u) du\\\\\n&= \\int_{-1}^1 f(u) du\\\\\n&= 1.\n\\end{align}\n$$\n\n\nSo the area of this transformed function is still $1$. The shifting by $c$ we know doesn't effect the area, the scaling by $h$ inside of $f$ does, but is balanced out by the multiplication by $h$ outside of $f$.\n\n\n##### Example: Speed versus velocity\n\n\nThe \"velocity\" of an object includes a sense of direction in addition to the sense of magnitude. The \"speed\" just includes the sense of magnitude. Speed is always non-negative, whereas velocity is a signed quantity.\n\n\nAs mentioned previously, position is the integral of velocity, as expressed precisely through this equation:\n\n\n\n$$\nx(t) = \\int_0^t v(u) du - x(0).\n$$\n\n\nWhat is the integral of speed?\n\n\nIf $v(t)$ is the velocity, the $s(t) = \\lvert v(t) \\rvert$ is the speed. If integrating either $s(t)$ or $v(t)$, the integrals would agree when $v(t) \\geq 0$. However, when $v(t) \\leq 0$, the position back tracks so $x(t)$ decreases, where the integral of $s(t)$ would only increase.\n\n\nThis integral\n\n\n\n$$\ntd(t) = \\int_0^t s(u) du = \\int_0^t \\lvert v(u) \\rvert du,\n$$\n\n\nGives the *total distance* traveled.\n\n\nTo illustrate with a simple example, if a car drives East for one hour at 60 miles per hour, then heads back West for an hour at 60 miles per hour, the car's position after one hour is $x(2) = x(0)$, with a change in position $x(2) - x(0) = 0$. Whereas, the total distance traveled is $120$ miles. (Gas is paid on total distance, not change in position!). What are the formulas for speed and velocity? Clearly $s(t) = 60$, a constant, whereas here $v(t) = 60$ for $0 \\leq t \\leq 1$ and $-60$ for $1 < t \\leq 2$.\n\n\nSuppose $v(t)$ is given by $v(t) = (t-2)^3/3 - 4(t-2)/3$. If $x(0)=0$ Find the position after 3 time units and the total distance traveled.\n\n\nWe let $u(t) = t - 2$ so $du=dt$. The position is given by\n\n\n\n$$\n\\int_0^3 ((t-2)^3/3 - 4(t-2)/3) dt = \\int_{u(0)}^{u(3)} (u^3/3 - 4/3 u) du =\n(\\frac{u^4}{12} - \\frac{4}{3}\\frac{u^2}{2}) \\big|_{-2}^1 = \\frac{3}{4}.\n$$\n\n\nThe speed is similar, but we have to work harder:\n\n\n\n$$\n\\int_0^3 \\lvert v(t) \\rvert dt = \\int_0^3 \\lvert ((t-2)^3/3 - 4(t-2)/3) \\rvert dt =\n\\int_{-2}^1 \\lvert u^3/3 - 4u/3 \\rvert du.\n$$\n\n\nBut $u^3/3 - 4u/3 = (1/3) \\cdot u(u-1)(u+2)$, so between $-2$ and $0$ it is positive and between $0$ and $1$ negative, so this integral is:\n\n\n\n$$\n\\begin{align*}\n\\int_{-2}^0 (u^3/3 - 4u/3 ) du + \\int_{0}^1 -(u^3/3 - 4u/3) du\n&= (\\frac{u^4}{12} - \\frac{4}{3}\\frac{u^2}{2}) \\big|_{-2}^0 - (\\frac{u^4}{12} - \\frac{4}{3}\\frac{u^2}{2}) \\big|_{0}^1\\\\\n&= \\frac{4}{3} - -\\frac{7}{12}\\\\\n&= \\frac{23}{12}.\n\\end{align*}\n$$\n\n\n##### Example\n\n\nIn probability, the normal distribution plays an outsized role. This distribution is characterized by a family of *density* functions:\n\n\n\n$$\nf(x; \\mu, \\sigma) = \\frac{1}{\\sqrt{2\\pi}}\\frac{1}{\\sigma} \\exp(-\\frac{1}{2}\\left(\\frac{x-\\mu}{\\sigma}\\right)^2).\n$$\n\n\nIntegrals involving this function are typically transformed by substitution. For example:\n\n\n\n$$\n\\begin{align*}\n\\int_a^b f(x; \\mu, \\sigma) dx\n&= \\int_a^b \\frac{1}{\\sqrt{2\\pi}}\\frac{1}{\\sigma} \\exp(-\\frac{1}{2}\\left(\\frac{x-\\mu}{\\sigma}\\right)^2) dx \\\\\n&= \\int_{u(a)}^{u(b)} \\frac{1}{\\sqrt{2\\pi}} \\exp(-\\frac{1}{2}u^2) du \\\\\n&= \\int_{u(a)}^{u(b)} f(u; 0, 1) du,\n\\end{align*}\n$$\n\n\nwhere $u = (x-\\mu)/\\sigma$, so $du = (1/\\sigma) dx$.\n\n\nThis shows that integrals involving a normal density with parameters $\\mu$ and $\\sigma$ can be computed using the *standard* normal density with $\\mu=0$ and $\\sigma=1$. Unfortunately, there is no elementary antiderivative for $\\exp(-u^2/2)$, so integrals for the standard normal must be numerically approximated.\n\n\nThere is a function `erf` in the `SpecialFunctions` package (which is loaded by `CalculusWithJulia`) that computes:\n\n\n\n$$\n\\int_0^x \\frac{2}{\\sqrt{\\pi}} \\exp(-t^2) dt\n$$\n\n\nA further change of variables by $t = u/\\sqrt{2}$ (with $\\sqrt{2}dt = du$) gives:\n\n\n\n$$\n\\begin{align*}\n\\int_a^b f(x; \\mu, \\sigma) dx &=\n\\int_{t(u(a))}^{t(u(b))} \\frac{\\sqrt{2}}{\\sqrt{2\\pi}} \\exp(-t^2) dt\\\\\n&= \\frac{1}{2} \\int_{t(u(a))}^{t(u(b))} \\frac{2}{\\sqrt{\\pi}} \\exp(-t^2) dt\n\\end{align*}\n$$\n\n\nUp to a factor of $1/2$ this is `erf`.\n\n\nSo we would have, for example, with $\\mu=1$,$\\sigma=2$ and $a=1$ and $b=3$ that:\n\n\n\n$$\n\\begin{align*}\nt(u(a)) &= (1 - 1)/2/\\sqrt{2} = 0\\\\\nt(u(b)) &= (3 - 1)/2/\\sqrt{2} = \\frac{1}{\\sqrt{2}}\\\\\n\\int_1^3 f(x; 1, 2)\n&= \\frac{1}{2} \\int_0^{1/\\sqrt{2}} \\frac{2}{\\sqrt{\\pi}} \\exp(-t^2) dt.\n\\end{align*}\n$$\n\n\nOr\n\n::: {.cell execution_count=5}\n``` {.julia .cell-code}\n1/2 * erf(1/sqrt(2))\n```\n\n::: {.cell-output .cell-output-display execution_count=6}\n```\n0.3413447460685429\n```\n:::\n:::\n\n\n:::{.callout-note}\n## The `Distributions` package\nThe above calculation is for illustration purposes. The add-on package `Distributions` makes much quicker work of such a task for the normal distribution and many other distributions from probability and statistics.\n\n:::\n\n## SymPy and substitution\n\n\nThe `integrate` function in `SymPy` can handle most problems which involve substitution. Here are a few examples:\n\n\n * This integral, $\\int_0^2 4x/\\sqrt{x^2 +1}dx$, involves a substitution for $x^2 + 1$:\n\n::: {.cell execution_count=6}\n``` {.julia .cell-code}\n@syms x::real t::real\nintegrate(4x / sqrt(x^2 + 1), (x, 0, 2))\n```\n\n::: {.cell-output .cell-output-display execution_count=7}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n-4 + 4 \\sqrt{5}\n\\]\n</span>\n```\n:::\n:::\n\n\n * This integral, $\\int_e^{e^2} 1/(x\\log(x)) dx$ involves a substitution of $u=\\log(x)$. Here we see the answer:\n\n::: {.cell hold='true' execution_count=7}\n``` {.julia .cell-code}\nf(x) = 1/(x*log(x))\nintegrate(f(x), (x, sympy.E, sympy.E^2))\n```\n\n::: {.cell-output .cell-output-display execution_count=8}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\log{\\left(2 \\right)}\n\\]\n</span>\n```\n:::\n:::\n\n\n(We used `sympy.E)` - and not `e` - to avoid any conversion to floating point, which could yield an inexact answer.)\n\n\nThe antiderivative is interesting here; it being an *iterated* logarithm.\n\n::: {.cell execution_count=8}\n``` {.julia .cell-code}\nintegrate(1/(x*log(x)), x)\n```\n\n::: {.cell-output .cell-output-display execution_count=9}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\log{\\left(\\log{\\left(x \\right)} \\right)}\n\\]\n</span>\n```\n:::\n:::\n\n\n### Failures...\n\n\nNot every integral problem lends itself to solution by substitution. For example, we can use substitution to evaluate the integral of $xe^{-x^2}$, but for $e^{-x^2}$ or $x^2e^{-x^2}$. The first has no familiar antiderivative, the second is done by a different technique.\n\n\nEven when substitution can be used, `SymPy` may not be able to algorithmically identify it. The main algorithm used can determine if expressions involving rational functions, radicals, logarithms, and exponential functions is integrable. Missing from this list are absolute values.\n\n\nFor some such problems, we can help `SymPy` out - by breaking the integral into pieces where we know the sign of the expression.\n\n\nFor substitution problems, we can also help out. For example, to find an antiderivative for\n\n\n\n$$\n\\int(1 + \\log(x)) \\sqrt{1 + (x\\log(x))^2} dx\n$$\n\n\nA quick attempt with `SymPy` turns up nothing:\n\n::: {.cell execution_count=9}\n``` {.julia .cell-code}\n𝒇(x) = (1 + log(x)) * sqrt(1 + (x*log(x))^2 )\nintegrate(𝒇(x), x)\n```\n\n::: {.cell-output .cell-output-display execution_count=10}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\int \\sqrt{x^{2} \\log{\\left(x \\right)}^{2} + 1} \\left(\\log{\\left(x \\right)} + 1\\right)\\, dx\n\\]\n</span>\n```\n:::\n:::\n\n\nBut were we to try $u=x\\log(x)$, we'd see that this simplifies to $\\int \\sqrt{1 + u^2} du$, which has some hope of having an antiderivative.\n\n\nWe can help `SymPy` out by substitution:\n\n::: {.cell execution_count=10}\n``` {.julia .cell-code}\nu(x) = x * log(x)\n@syms w dw\nex = 𝒇(x)\nex₁ = ex(u(x) => w, diff(u(x),x) => dw)\n```\n\n::: {.cell-output .cell-output-display execution_count=11}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\ndw \\sqrt{w^{2} + 1}\n\\]\n</span>\n```\n:::\n:::\n\n\nThis verifies the above. Can it be integrated in `w`? The \"`dw`\" is only for familiarity, `SymPy` doesn't use this, so we set it to 1 then integrate:\n\n::: {.cell execution_count=11}\n``` {.julia .cell-code}\nex₂ = ex₁(dw => 1)\nex₃ = integrate(ex₂, w)\n```\n\n::: {.cell-output .cell-output-display execution_count=12}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\frac{w \\sqrt{w^{2} + 1}}{2} + \\frac{\\operatorname{asinh}{\\left(w \\right)}}{2}\n\\]\n</span>\n```\n:::\n:::\n\n\nFinally, we put back in the `u(x)` to get an antiderivative.\n\n::: {.cell execution_count=12}\n``` {.julia .cell-code}\nex₃(w => u(x))\n```\n\n::: {.cell-output .cell-output-display execution_count=13}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\frac{x \\sqrt{x^{2} \\log{\\left(x \\right)}^{2} + 1} \\log{\\left(x \\right)}}{2} + \\frac{\\operatorname{asinh}{\\left(x \\log{\\left(x \\right)} \\right)}}{2}\n\\]\n</span>\n```\n:::\n:::\n\n\n:::{.callout-note}\n## Note\nLest it be thought this is an issue with `SymPy`, but not other systems, this example was [borrowed](http://faculty.uml.edu/jpropp/142/Integration.pdf) from an illustration for helping Mathematica.\n\n:::\n\n## Trigonometric substitution\n\n\nWait, in the last example an antiderivative for $\\sqrt{1 + u^2}$ was found. But how? We haven't discussed this yet.\n\n\nThis can be found using *trigonometric* substitution. In this example, we know that $1 + \\tan(\\theta)^2$ simplifies to $\\sec(\\theta)^2$, so we might *try* a substitution of $\\tan(u)=x$. This would simplify $\\sqrt{1 + x^2}$ to $\\sqrt{1 + \\tan(u)^2} = \\sqrt{\\sec(u)^2}$ which is $\\lvert \\sec(u) \\rvert$. What of $du$? The chain rule gives $\\sec(u)^2du = dx$. In short we get:\n\n\n\n$$\n\\int \\sqrt{1 + x^2} dx = \\int \\sec(u)^2 \\lvert \\sec(u) \\rvert du = \\int \\sec(u)^3 du,\n$$\n\n\nif we know $\\sec(u) \\geq 0$.\n\n\nThis leaves still the question of integrating $\\sec(u)^3$, which we aren't (yet) prepared to discuss, but we see that this type of substitution can re-express an integral in a new way that may pay off.\n\n\n#### Examples\n\n\nLet's see some examples where a trigonometric substitution is all that is needed.\n\n\n##### Example\n\n\nConsider $\\int 1/(1+x^2) dx$. This is an antiderivative of some function, but if that isn't observed, we might notice the $1+x^2$ and try to simplify that. First, an attempt at a $u$-substitution:\n\n\nLetting $u = 1+x^2$ we get $du = 2xdx$ which gives $\\int (1/u) (2x) du$. We aren't able to address the \"$2x$\" part successfully, so this attempt is for naught.\n\n\nNow we try a trigonometric substitution, taking advantage of the identity $1+\\tan(x)^2 = \\sec(x)^2$. Letting $\\tan(u) = x$ yields $\\sec(u)^2 du = dx$ and we get:\n\n\n\n$$\n\\int \\frac{1}{1+x^2} dx = \\int \\frac{1}{1 + \\tan(u)^2} \\sec(u)^2 du = \\int 1 du = u.\n$$\n\n\nBut $\\tan(u) = x$, so in terms of $x$, an antiderivative is just $\\tan^{-1}(x)$, or the arctangent. Here we verify with `SymPy`:\n\n::: {.cell execution_count=13}\n``` {.julia .cell-code}\nintegrate(1/(1+x^2), x)\n```\n\n::: {.cell-output .cell-output-display execution_count=14}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\operatorname{atan}{\\left(x \\right)}\n\\]\n</span>\n```\n:::\n:::\n\n\nThe general form allows $a^2 + (bx)^2$ in the denominator (squared so both are positive and the answer is nicer):\n\n::: {.cell hold='true' execution_count=14}\n``` {.julia .cell-code}\n@syms a::real, b::real, x::real\nintegrate(1 / (a^2 + (b*x)^2), x)\n```\n\n::: {.cell-output .cell-output-display execution_count=15}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\frac{\\operatorname{atan}{\\left(\\frac{b x}{a} \\right)}}{a b}\n\\]\n</span>\n```\n:::\n:::\n\n\n##### Example\n\n\nThe expression $1-x^2$ can be attacked by the substitution $\\sin(u) =x$ as then $1-x^2 = 1-\\cos(u)^2 = \\sin(u)^2$. Here we see this substitution being used successfully:\n\n\n\n$$\n\\begin{align*}\n\\int \\frac{1}{\\sqrt{9 - x^2}} dx &= \\int \\frac{1}{\\sqrt{9 - (3\\sin(u))^2}} \\cdot 3\\cos(u) du\\\\\n&=\\int \\frac{1}{3\\sqrt{1 - \\sin(u)^2}}\\cdot3\\cos(u) du \\\\\n&= \\int du \\\\\n&= u \\\\\n&= \\sin^{-1}(x/3).\n\\end{align*}\n$$\n\n\nFurther substitution allows the following integral to be solved for an antiderivative:\n\n::: {.cell hold='true' execution_count=15}\n``` {.julia .cell-code}\n@syms a::real, b::real\nintegrate(1 / sqrt(a^2 - b^2*x^2), x)\n```\n\n::: {.cell-output .cell-output-display execution_count=16}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\begin{cases} - \\frac{i x \\left|{a}\\right| \\operatorname{acosh}{\\left(\\frac{\\left|{b}\\right| \\left|{x}\\right|}{\\left|{a}\\right|} \\right)}}{a \\left|{b}\\right| \\left|{x}\\right|} + \\frac{\\pi x \\left|{a}\\right|}{2 a \\left|{b}\\right| \\left|{x}\\right|} & \\text{for}\\: \\frac{b^{2} x^{2}}{a^{2}} > 1 \\\\\\frac{x \\left|{a}\\right| \\operatorname{asin}{\\left(\\frac{\\left|{b}\\right| \\left|{x}\\right|}{\\left|{a}\\right|} \\right)}}{a \\left|{b}\\right| \\left|{x}\\right|} & \\text{otherwise} \\end{cases}\n\\]\n</span>\n```\n:::\n:::\n\n\n##### Example\n\n\nThe expression $x^2 - 1$ is a bit different, this lends itself to $\\sec(u) = x$ for a substitution, for $\\sec(u)^2 - 1 = \\tan(u)^2$. For example, we try $\\sec(u) = x$ to integrate:\n\n\n\n$$\n\\begin{align*}\n\\int \\frac{1}{\\sqrt{x^2 - 1}} dx &= \\int \\frac{1}{\\sqrt{\\sec(u)^2 - 1}} \\cdot \\sec(u)\\tan(u) du\\\\\n&=\\int \\frac{1}{\\tan(u)}\\sec(u)\\tan(u) du\\\\\n&= \\int \\sec(u) du.\n\\end{align*}\n$$\n\n\nThis doesn't seem that helpful, but the antiderivative to $\\sec(u)$ is $\\log\\lvert (\\sec(u) + \\tan(u))\\rvert$, so we can proceed to get:\n\n\n\n$$\n\\begin{align*}\n\\int \\frac{1}{\\sqrt{x^2 - 1}} dx &= \\int \\sec(u) du\\\\\n&= \\log\\lvert (\\sec(u) + \\tan(u))\\rvert\\\\\n&= \\log\\lvert x + \\sqrt{x^2-1} \\rvert.\n\\end{align*}\n$$\n\n\nSymPy gives a different representation using the arccosine:\n\n::: {.cell hold='true' execution_count=16}\n``` {.julia .cell-code}\n@syms a::positive, b::positive, x::real\nintegrate(1 / sqrt(a^2*x^2 - b^2), x)\n```\n\n::: {.cell-output .cell-output-display execution_count=17}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\frac{\\operatorname{acosh}{\\left(\\frac{a x}{b} \\right)}}{a}\n\\]\n</span>\n```\n:::\n:::\n\n\n##### Example\n\n\nThe equation of an ellipse is $x^2/a^2 + y^2/b^2 = 1$. Suppose $a,b>0$. The area under the function $b \\sqrt{1 - x^2/a^2}$ between $-a$ and $a$ will then be half the area of the ellipse. Find the area enclosed by the ellipse.\n\n\nWe need to compute:\n\n\n\n$$\n2\\int_{-a}^a b \\sqrt{1 - x^2/a^2} dx =\n4 b \\int_0^a\\sqrt{1 - x^2/a^2} dx.\n$$\n\n\nLetting $\\sin(u) = x/a$ gives $a\\cos(u)du = dx$ and an antiderivative is found with:\n\n\n\n$$\n4 b \\int_0^a \\sqrt{1 - x^2/a^2} dx = 4b \\int_0^{\\pi/2} \\sqrt{1-u^2} a \\cos(u) du\n= 4ab \\int_0^{\\pi/2} \\cos(u)^2 du\n$$\n\n\nThe identify $\\cos(u)^2 = (1 + \\cos(2u))/2$ makes this tractable:\n\n\n\n$$\n\\begin{align*}\n4ab \\int \\cos(u)^2 du\n&= 4ab\\int_0^{\\pi/2}(\\frac{1}{2} + \\frac{\\cos(2u)}{2}) du\\\\\n&= 4ab(\\frac{1}{2}u + \\frac{\\sin(2u)}{4})\\big|_0^{\\pi/2}\\\\\n&= 4ab (\\pi/4 + 0) = \\pi ab.\n\\end{align*}\n$$\n\n\nKeeping in mind that that a circle with radius $a$ is an ellipse with $b=a$, we see that this gives the correct answer for a circle.\n\n\n## Questions\n\n\n###### Question\n\n\nFor $\\int \\sin(x) \\cos(x) dx$, let $u=\\sin(x)$. What is the resulting substitution?\n\n::: {.cell hold='true' execution_count=17}\n\n::: {.cell-output .cell-output-display execution_count=18}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='16746168862769873063' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_16746168862769873063\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_16746168862769873063_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_16746168862769873063\"\n id=\"radio_16746168862769873063_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\int u (1 - u^2) du\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_16746168862769873063_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_16746168862769873063\"\n id=\"radio_16746168862769873063_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\int u du\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_16746168862769873063_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_16746168862769873063\"\n id=\"radio_16746168862769873063_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\int u \\cos(x) du\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='16746168862769873063_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_16746168862769873063\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 2;\n var msgBox = document.getElementById('16746168862769873063_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_16746168862769873063\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_16746168862769873063\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nFor $\\int \\tan(x)^4 \\sec(x)2 dx$ what $u$-substitution makes this easy?\n\n::: {.cell hold='true' execution_count=18}\n\n::: {.cell-output .cell-output-display execution_count=19}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='2319460748349250542' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_2319460748349250542\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_2319460748349250542_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_2319460748349250542\"\n id=\"radio_2319460748349250542_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=\\tan(x)\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_2319460748349250542_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_2319460748349250542\"\n id=\"radio_2319460748349250542_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=\\sec(x)^2\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_2319460748349250542_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_2319460748349250542\"\n id=\"radio_2319460748349250542_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=\\sec(x)\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_2319460748349250542_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_2319460748349250542\"\n id=\"radio_2319460748349250542_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=\\tan(x)^4\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='2319460748349250542_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_2319460748349250542\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 1;\n var msgBox = document.getElementById('2319460748349250542_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_2319460748349250542\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_2319460748349250542\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nFor $\\int x \\sqrt{x^2 - 1} dx$ what $u$ substitution makes this easy?\n\n::: {.cell hold='true' execution_count=19}\n\n::: {.cell-output .cell-output-display execution_count=20}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='929830638715641208' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_929830638715641208\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_929830638715641208_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_929830638715641208\"\n id=\"radio_929830638715641208_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=\\sqrt{x^2 - 1}\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_929830638715641208_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_929830638715641208\"\n id=\"radio_929830638715641208_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=x^2 - 1\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_929830638715641208_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_929830638715641208\"\n id=\"radio_929830638715641208_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_929830638715641208_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_929830638715641208\"\n id=\"radio_929830638715641208_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=x^2\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='929830638715641208_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_929830638715641208\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 2;\n var msgBox = document.getElementById('929830638715641208_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_929830638715641208\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_929830638715641208\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nFor $\\int x^2(1-x)^2 dx$ will the substitution $u=1-x$ prove effective?\n\n::: {.cell hold='true' execution_count=20}\n\n::: {.cell-output .cell-output-display execution_count=21}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='13425140540783858566' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_13425140540783858566\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_13425140540783858566_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_13425140540783858566\"\n id=\"radio_13425140540783858566_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n Yes\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_13425140540783858566_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_13425140540783858566\"\n id=\"radio_13425140540783858566_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n No\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='13425140540783858566_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_13425140540783858566\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 2;\n var msgBox = document.getElementById('13425140540783858566_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_13425140540783858566\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_13425140540783858566\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\nWhat about expanding the factored polynomial to get a fourth degree polynomial, will this prove effective?\n\n::: {.cell hold='true' execution_count=21}\n\n::: {.cell-output .cell-output-display execution_count=22}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='7884941333517863931' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_7884941333517863931\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_7884941333517863931_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_7884941333517863931\"\n id=\"radio_7884941333517863931_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n Yes\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_7884941333517863931_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_7884941333517863931\"\n id=\"radio_7884941333517863931_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n No\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='7884941333517863931_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_7884941333517863931\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 1;\n var msgBox = document.getElementById('7884941333517863931_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_7884941333517863931\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_7884941333517863931\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nFor $\\int (\\log(x))^3/x dx$ the substitution $u=\\log(x)$ reduces this to what?\n\n::: {.cell hold='true' execution_count=22}\n\n::: {.cell-output .cell-output-display execution_count=23}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='8832051585607433668' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_8832051585607433668\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_8832051585607433668_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_8832051585607433668\"\n id=\"radio_8832051585607433668_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\int u du\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_8832051585607433668_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_8832051585607433668\"\n id=\"radio_8832051585607433668_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\int u^3/x du\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_8832051585607433668_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_8832051585607433668\"\n id=\"radio_8832051585607433668_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\int u^3 du\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='8832051585607433668_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_8832051585607433668\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 3;\n var msgBox = document.getElementById('8832051585607433668_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_8832051585607433668\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_8832051585607433668\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nFor $\\int \\tan(x) dx$ what substitution will prove effective?\n\n::: {.cell hold='true' execution_count=23}\n\n::: {.cell-output .cell-output-display execution_count=24}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='12388155574224826075' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_12388155574224826075\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_12388155574224826075_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_12388155574224826075\"\n id=\"radio_12388155574224826075_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=\\tan(x)\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_12388155574224826075_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_12388155574224826075\"\n id=\"radio_12388155574224826075_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=\\sin(x)\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_12388155574224826075_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_12388155574224826075\"\n id=\"radio_12388155574224826075_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(u=\\cos(x)\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='12388155574224826075_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_12388155574224826075\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 3;\n var msgBox = document.getElementById('12388155574224826075_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_12388155574224826075\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_12388155574224826075\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nIntegrating $\\int_0^1 x \\sqrt{1 - x^2} dx$ can be done by using the $u$-substitution $u=1-x^2$. This yields an integral\n\n\n\n$$\n\\int_a^b \\frac{-\\sqrt{u}}{2} du.\n$$\n\n\nWhat are $a$ and $b$?\n\n::: {.cell hold='true' execution_count=24}\n\n::: {.cell-output .cell-output-display execution_count=25}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='1260642748268818163' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_1260642748268818163\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_1260642748268818163_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_1260642748268818163\"\n id=\"radio_1260642748268818163_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(a=1,~ b=0\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_1260642748268818163_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_1260642748268818163\"\n id=\"radio_1260642748268818163_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(a=0,~ b=0\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_1260642748268818163_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_1260642748268818163\"\n id=\"radio_1260642748268818163_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(a=1,~ b=1\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_1260642748268818163_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_1260642748268818163\"\n id=\"radio_1260642748268818163_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(a=0,~ b=1\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='1260642748268818163_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_1260642748268818163\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 4;\n var msgBox = document.getElementById('1260642748268818163_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_1260642748268818163\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_1260642748268818163\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nThe integral $\\int \\sqrt{1 - x^2} dx$ lends itself to what substitution?\n\n::: {.cell hold='true' execution_count=25}\n\n::: {.cell-output .cell-output-display execution_count=26}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='9816442339115992491' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_9816442339115992491\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_9816442339115992491_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_9816442339115992491\"\n id=\"radio_9816442339115992491_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(u = 1 - x^2\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_9816442339115992491_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_9816442339115992491\"\n id=\"radio_9816442339115992491_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\tan(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_9816442339115992491_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_9816442339115992491\"\n id=\"radio_9816442339115992491_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sin(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_9816442339115992491_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_9816442339115992491\"\n id=\"radio_9816442339115992491_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sec(u) = x\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='9816442339115992491_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_9816442339115992491\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 3;\n var msgBox = document.getElementById('9816442339115992491_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_9816442339115992491\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_9816442339115992491\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nThe integral $\\int x/(1+x^2) dx$ lends itself to what substitution?\n\n::: {.cell hold='true' execution_count=26}\n\n::: {.cell-output .cell-output-display execution_count=27}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='6705820243768511417' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_6705820243768511417\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_6705820243768511417_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_6705820243768511417\"\n id=\"radio_6705820243768511417_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(u = 1 + x^2\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_6705820243768511417_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_6705820243768511417\"\n id=\"radio_6705820243768511417_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sec(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_6705820243768511417_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_6705820243768511417\"\n id=\"radio_6705820243768511417_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\tan(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_6705820243768511417_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_6705820243768511417\"\n id=\"radio_6705820243768511417_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sin(u) = x\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='6705820243768511417_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_6705820243768511417\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 1;\n var msgBox = document.getElementById('6705820243768511417_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_6705820243768511417\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_6705820243768511417\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nThe integral $\\int dx / \\sqrt{1 - x^2}$ lends itself to what substitution?\n\n::: {.cell hold='true' execution_count=27}\n\n::: {.cell-output .cell-output-display execution_count=28}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='7715812252684175965' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_7715812252684175965\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_7715812252684175965_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_7715812252684175965\"\n id=\"radio_7715812252684175965_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\tan(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_7715812252684175965_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_7715812252684175965\"\n id=\"radio_7715812252684175965_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(u = 1 - x^2\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_7715812252684175965_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_7715812252684175965\"\n id=\"radio_7715812252684175965_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sin(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_7715812252684175965_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_7715812252684175965\"\n id=\"radio_7715812252684175965_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sec(u) = x\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='7715812252684175965_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_7715812252684175965\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 3;\n var msgBox = document.getElementById('7715812252684175965_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_7715812252684175965\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_7715812252684175965\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nThe integral $\\int dx / \\sqrt{x^2 - 16}$ lends itself to what substitution?\n\n::: {.cell hold='true' execution_count=28}\n\n::: {.cell-output .cell-output-display execution_count=29}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='17473887115112980222' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_17473887115112980222\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_17473887115112980222_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_17473887115112980222\"\n id=\"radio_17473887115112980222_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(4\\sec(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_17473887115112980222_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_17473887115112980222\"\n id=\"radio_17473887115112980222_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sec(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_17473887115112980222_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_17473887115112980222\"\n id=\"radio_17473887115112980222_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sin(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_17473887115112980222_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_17473887115112980222\"\n id=\"radio_17473887115112980222_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(4\\sin(u) = x\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='17473887115112980222_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_17473887115112980222\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 1;\n var msgBox = document.getElementById('17473887115112980222_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_17473887115112980222\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_17473887115112980222\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nThe integral $\\int dx / (a^2 + x^2)$ lends itself to what substitution?\n\n::: {.cell hold='true' execution_count=29}\n\n::: {.cell-output .cell-output-display execution_count=30}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='9785040180496417213' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_9785040180496417213\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_9785040180496417213_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_9785040180496417213\"\n id=\"radio_9785040180496417213_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\tan(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_9785040180496417213_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_9785040180496417213\"\n id=\"radio_9785040180496417213_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\tan(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_9785040180496417213_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_9785040180496417213\"\n id=\"radio_9785040180496417213_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(a\\sec(u) = x\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_9785040180496417213_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_9785040180496417213\"\n id=\"radio_9785040180496417213_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(\\sec(u) = x\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='9785040180496417213_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_9785040180496417213\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 1;\n var msgBox = document.getElementById('9785040180496417213_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_9785040180496417213\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_9785040180496417213\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nThe integral $\\int_{1/2}^1 \\sqrt{1 - x^2}dx$ can be approached with the substitution $\\sin(u) = x$ giving:\n\n\n\n$$\n\\int_a^b \\cos(u)^2 du.\n$$\n\n\nWhat are $a$ and $b$?\n\n::: {.cell hold='true' execution_count=30}\n\n::: {.cell-output .cell-output-display execution_count=31}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='5350435097460811136' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_5350435097460811136\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_5350435097460811136_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_5350435097460811136\"\n id=\"radio_5350435097460811136_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n \\(a=1/2,~ b= 1\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_5350435097460811136_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_5350435097460811136\"\n id=\"radio_5350435097460811136_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n \\(a=\\pi/3,~ b=\\pi/2\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_5350435097460811136_3\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_5350435097460811136\"\n id=\"radio_5350435097460811136_3\" value=\"3\">\n </input>\n <span class=\"label-body px-1\">\n \\(a=\\pi/6,~ b=\\pi/2\\)\n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_5350435097460811136_4\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_5350435097460811136\"\n id=\"radio_5350435097460811136_4\" value=\"4\">\n </input>\n <span class=\"label-body px-1\">\n \\(a=\\pi/4,~ b=\\pi/2\\)\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='5350435097460811136_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_5350435097460811136\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 3;\n var msgBox = document.getElementById('5350435097460811136_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_5350435097460811136\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_5350435097460811136\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n###### Question\n\n\nHow would we verify that $\\log\\lvert (\\sec(u) + \\tan(u))\\rvert$ is an antiderivative for $\\sec(u)$?\n\n::: {.cell hold='true' execution_count=31}\n\n::: {.cell-output .cell-output-display execution_count=32}\n```{=html}\n<form class=\"mx-2 my-3 mw-100\" name='WeaveQuestion' data-id='18132241296680278339' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form\" id=\"controls_18132241296680278339\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_18132241296680278339_1\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_18132241296680278339\"\n id=\"radio_18132241296680278339_1\" value=\"1\">\n </input>\n <span class=\"label-body px-1\">\n We could differentiate \\(\\log\\lvert (\\sec(u) + \\tan(u))\\rvert\\) \n </span>\n </label>\n</div>\n<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"radio_18132241296680278339_2\">\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_18132241296680278339\"\n id=\"radio_18132241296680278339_2\" value=\"2\">\n </input>\n <span class=\"label-body px-1\">\n We could differentiate \\(\\sec(u)\\).\n </span>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='18132241296680278339_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_18132241296680278339\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 1;\n var msgBox = document.getElementById('18132241296680278339_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍 Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_18132241296680278339\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎 Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_18132241296680278339\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n",
|
||
"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"
|
||
]
|
||
}
|
||
}
|
||
} |