CalculusWithJuliaNotes.jl/quarto/_freeze/integrals/partial_fractions/execute-results/html.json
2022-07-24 16:38:24 -04:00

15 lines
45 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"hash": "a688cc690bd549f15aa17b76121c94e7",
"result": {
"markdown": "# Partial Fractions\n\n\n\n``` {.julia .cell-code}\nusing CalculusWithJulia\nusing SymPy\n```\n\n\n\n\n---\n\n\nIntegration is facilitated when an antiderivative for $f$ can be found, as then definite integrals can be evaluated through the fundamental theorem of calculus.\n\n\nHowever, despite integration being an algorithmic procedure, integration is not. There are \"tricks\" to try, such as substitution and integration by parts. These work in some cases. However, there are classes of functions for which algorithms exist. For example, the `SymPy` `integrate` function mostly implements an algorithm that decides if an elementary function has an antiderivative. The [elementary](http://en.wikipedia.org/wiki/Elementary_function) functions include exponentials, their inverses (logarithms), trigonometric functions, their inverses, and powers, including $n$th roots. Not every elementary function will have an antiderivative comprised of (finite) combinations of elementary functions. The typical example is $e^{x^2}$, which has no simple antiderivative, despite its ubiquitousness.\n\n\nThere are classes of functions where an (elementary) antiderivative can always be found. Polynomials provide a case. More surprisingly, so do their ratios, *rational functions*.\n\n\n## Partial fraction decomposition\n\n\nLet $f(x) = p(x)/q(x)$, where $p$ and $q$ are polynomial functions with real coefficients. Further, we assume without comment that $p$ and $q$ have no common factors. (If they did, we can divide them out, an act which has no effect on the integrability of $f(x)$.\n\n\nThe function $q(x)$ will factor over the real numbers. The fundamental theorem of algebra can be applied to say that $q(x)=q_1(x)^{n_1} \\cdots q_k(x)^{n_k}$ where $q_i(x)$ is a linear or quadratic polynomial and $n_k$ a positive integer.\n\n\n> **Partial Fraction Decomposition**: There are unique polynomials $a_{ij}$ with degree $a_{ij} <$ degree $q_i$ such that\n>\n> $$\n> \\frac{p(x)}{q(x)} = a(x) + \\sum_{i=1}^k \\sum_{j=1}^{n_i} \\frac{a_{ij}(x)}{q_i(x)^j}.\n> $$\n\n\n\nThe method is attributed to John Bernoulli, one of the prolific Bernoulli brothers who put a stamp on several areas of math. This Bernoulli was a mentor to Euler.\n\n\nThis basically says that each factor $q_i(x)^{n_i}$ contributes a term like:\n\n\n\n$$\n\\frac{a_{i1}(x)}{q_i(x)^1} + \\frac{a_{i2}(x)}{q_i(x)^2} + \\cdots + \\frac{a_{in_i}(x)}{q_i(x)^{n_i}},\n$$\n\n\nwhere each $a_{ij}(x)$ has degree less than the degree of $q_i(x)$.\n\n\nThe value of this decomposition is that the terms $a_{ij}(x)/q_i(x)^j$ each have an antiderivative, and so the sum of them will also have an antiderivative.\n\n\n:::{.callout-note}\n## Note\nMany calculus texts will give some examples for finding a partial fraction decomposition. We push that work off to `SymPy`, as for all but the easiest cases - a few are in the problems - it can be a bit tedious.\n\n:::\n\nIn `SymPy`, the `apart` function will find the partial fraction decomposition when a factorization is available. For example, here we see $n_i$ terms for each power of $q_i$\n\n::: {.cell execution_count=4}\n``` {.julia .cell-code}\n@syms a::real b::real c::real A::real B::real x::real\n```\n\n::: {.cell-output .cell-output-display execution_count=5}\n```\n(a, b, c, A, B, x)\n```\n:::\n:::\n\n\n::: {.cell execution_count=5}\n``` {.julia .cell-code}\napart((x-2)*(x-3) / (x*(x-1)^2*(x^2 + 2)^3))\n```\n\n::: {.cell-output .cell-output-display execution_count=6}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n- \\frac{8 x - 13}{9 \\left(x^{2} + 2\\right)^{3}} - \\frac{35 x - 34}{54 \\left(x^{2} + 2\\right)^{2}} - \\frac{45 x - 28}{108 \\left(x^{2} + 2\\right)} - \\frac{1}{3 \\left(x - 1\\right)} + \\frac{2}{27 \\left(x - 1\\right)^{2}} + \\frac{3}{4 x}\n\\]\n</span>\n```\n:::\n:::\n\n\n### Sketch of proof\n\n\nA standard proof uses two facts of number systems: the division algorithm and a representation of the greatest common divisor in terms of sums, extended to polynomials. Our sketch shows how these are used.\n\n\nTake one of the factors of the denominators, and consider this representation of the rational function $P(x)/(q(x)^k Q(x))$ where there are no common factors to any of the three polynomials.\n\n\nSince $q(x)$ and $Q(x)$ share no factors, [Bezout's](http://tinyurl.com/kd6prns) identity says there exists polynomials $a(x)$ and $b(x)$ with:\n\n\n\n$$\na(x) Q(x) + b(x) q(x) = 1.\n$$\n\n\nThen dividing by $q^k(x)Q(x)$ gives the decomposition\n\n\n\n$$\n\\frac{1}{q(x)^k Q(x)} = \\frac{a(x)}{q(x)^k} + \\frac{b(x)}{q(x)^{k-1}Q(x)}.\n$$\n\n\nSo we get by multiplying the $P(x)$:\n\n\n\n$$\n\\frac{P(x)}{q(x)^k Q(x)} = \\frac{A(x)}{q(x)^k} + \\frac{B(x)}{q(x)^{k-1}Q(x)}.\n$$\n\n\nThis may look more complicated, but what it does is peel off one term (The first) and leave something which is smaller, in this case by a factor of $q(x)$. This process can be repeated pulling off a power of a factor at a time until nothing is left to do.\n\n\nWhat remains is to establish that we can take $A(x) = a(x)\\cdot P(x)$ with a degree less than that of $q(x)$.\n\n\nIn Proposition 3.8 of [Bradley](http://www.m-hikari.com/imf/imf-2012/29-32-2012/cookIMF29-32-2012.pdf) and Cook we can see how. Recall the division algorithm, for example, says there are $q_k$ and $r_k$ with $A=q\\cdot q_k + r_k$ where the degree of $r_k$ is less than that of $q$, which is linear or quadratic. This is repeatedly applied below:\n\n\n\n$$\n\\begin{align*}\n\\frac{A}{q^k} &= \\frac{q\\cdot q_k + r_k}{q^k}\\\\\n&= \\frac{r_k}{q^k} + \\frac{q_k}{q^{k-1}}\\\\\n&= \\frac{r_k}{q^k} + \\frac{q \\cdot q_{k-1} + r_{k-1}}{q^{k-1}}\\\\\n&= \\frac{r_k}{q^k} + \\frac{r_{k-1}}{q^{k-1}} + \\frac{q_{k-1}}{q^{k-2}}\\\\\n&= \\frac{r_k}{q^k} + \\frac{r_{k-1}}{q^{k-1}} + \\frac{q\\cdot q_{k-2} + r_{k-2}}{q^{k-2}}\\\\\n&= \\cdots\\\\\n&= \\frac{r_k}{q^k} + \\frac{r_{k-1}}{q^{k-1}} + \\cdots + q_1.\n\\end{align*}\n$$\n\n\nSo the term $A(x)/q(x)^k$ can be expressed in terms of a sum where the numerators or each term have degree less than $q(x)$, as expected by the statement of the theorem.\n\n\n## Integrating the terms in a partial fraction decomposition\n\n\nWe discuss, by example, how each type of possible term in a partial fraction decomposition has an antiderivative. Hence, rational functions will *always* have an antiderivative that can be computed.\n\n\n### Linear factors\n\n\nFor $j=1$, if $q_i$ is linear, then $a_{ij}/q_i^j$ must look like a constant over a linear term, or something like:\n\n::: {.cell execution_count=6}\n``` {.julia .cell-code}\np = a/(x-c)\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\\frac{a}{- c + x}\n\\]\n</span>\n```\n:::\n:::\n\n\nThis has a logarithmic antiderivative:\n\n::: {.cell execution_count=7}\n``` {.julia .cell-code}\nintegrate(p, x)\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\\[\na \\log{\\left(- c + x \\right)}\n\\]\n</span>\n```\n:::\n:::\n\n\nFor $j > 1$, we have powers.\n\n::: {.cell execution_count=8}\n``` {.julia .cell-code}\n@syms j::positive\nintegrate(a/(x-c)^j, 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\\[\na \\left(\\begin{cases} \\frac{\\left(- c + x\\right)^{1 - j}}{1 - j} & \\text{for}\\: j \\neq 1 \\\\\\log{\\left(- c + x \\right)} & \\text{otherwise} \\end{cases}\\right)\n\\]\n</span>\n```\n:::\n:::\n\n\n### Quadratic factors\n\n\nWhen $q_i$ is quadratic, it looks like $ax^2 + bx + c$. Then $a_{ij}$ can be a constant or a linear polynomial. The latter can be written as $Ax + B$.\n\n\nThe integral of the following general form is presented below:\n\n\n\n$$\n\\frac{Ax +B }{(ax^2 + bx + c)^j},\n$$\n\n\nWith `SymPy`, we consider a few cases of the following form, which results from a shift of `x`\n\n\n\n$$\n\\frac{Ax + B}{((ax)^2 \\pm 1)^j}\n$$\n\n\nThis can be done by finding a $d$ so that $a(x-d)^2 + b(x-d) + c = dx^2 + e = e((\\sqrt{d/e}x^2 \\pm 1)$.\n\n\nThe integrals of the type $Ax/((ax)^2 \\pm 1)$ can completed by $u$-substitution, with $u=(ax)^2 \\pm 1$.\n\n\nFor example,\n\n::: {.cell execution_count=9}\n``` {.julia .cell-code}\nintegrate(A*x/((a*x)^2 + 1)^4, 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- \\frac{A}{6 a^{8} x^{6} + 18 a^{6} x^{4} + 18 a^{4} x^{2} + 6 a^{2}}\n\\]\n</span>\n```\n:::\n:::\n\n\nThe integrals of the type $B/((ax)^2\\pm 1)$ are completed by trigonometric substitution and various reduction formulas. They can get involved, but are tractable. For example:\n\n::: {.cell execution_count=10}\n``` {.julia .cell-code}\nintegrate(B/((a*x)^2 + 1)^4, x)\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\\[\nB \\left(\\frac{15 a^{4} x^{5} + 40 a^{2} x^{3} + 33 x}{48 a^{6} x^{6} + 144 a^{4} x^{4} + 144 a^{2} x^{2} + 48} + \\frac{5 \\operatorname{atan}{\\left(a x \\right)}}{16 a}\\right)\n\\]\n</span>\n```\n:::\n:::\n\n\nand\n\n::: {.cell execution_count=11}\n``` {.julia .cell-code}\nintegrate(B/((a*x)^2 - 1)^4, x)\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\\[\nB \\left(\\frac{- 15 a^{4} x^{5} + 40 a^{2} x^{3} - 33 x}{48 a^{6} x^{6} - 144 a^{4} x^{4} + 144 a^{2} x^{2} - 48} - \\frac{5 \\log{\\left(x - \\frac{1}{a} \\right)}}{32 a} + \\frac{5 \\log{\\left(x + \\frac{1}{a} \\right)}}{32 a}\\right)\n\\]\n</span>\n```\n:::\n:::\n\n\n---\n\nIn [Bronstein](http://www-sop.inria.fr/cafe/Manuel.Bronstein/publications/issac98.pdf) this characterization can be found - \"This method, which dates back to Newton, Leibniz and Bernoulli, should not be used in practice, yet it remains the method found in most calculus texts and is often taught. Its major drawback is the factorization of the denominator of the integrand over the real or complex numbers.\" We can also find the following formulas which formalize the above exploratory calculations ($j>1$ and $b^2 - 4c < 0$ below):\n\n\n\n$$\n\\begin{align*}\n\\int \\frac{A}{(x-a)^j} &= \\frac{A}{1-j}\\frac{1}{(x-a)^{1-j}}\\\\\n\\int \\frac{A}{x-a} &= A\\log(x-a)\\\\\n\\int \\frac{Bx+C}{x^2 + bx + c} &= \\frac{B}{2} \\log(x^2 + bx + c) + \\frac{2C-bB}{\\sqrt{4c-b^2}}\\cdot \\arctan\\left(\\frac{2x+b}{\\sqrt{4c-b^2}}\\right)\\\\\n\\int \\frac{Bx+C}{(x^2 + bx + c)^j} &= \\frac{B' x + C'}{(x^2 + bx + c)^{j-1}} + \\int \\frac{C''}{(x^2 + bx + c)^{j-1}}\n\\end{align*}\n$$\n\n\nThe first returns a rational function; the second yields a logarithm term; the third yields a logarithm and an arctangent term; while the last, which has explicit constants available, provides a reduction that can be recursively applied;\n\n\nThat is integrating $f(x)/g(x)$, a rational function, will yield an output that looks like the following, where the functions are polynomials:\n\n\n\n$$\n\\int f(x)/g(x) = P(x) + \\frac{C(x)}{D{x}} + \\sum v_i \\log(V_i(x)) + \\sum w_j \\arctan(W_j(x))\n$$\n\n\n(Bronstein also sketches the modern method which is to use a Hermite reduction to express $\\int (f/g) dx = p/q + \\int (g/h) dx$, where $h$ is square free (the \"`j`\" are all $1$). The latter can be written over the complex numbers as logarithmic terms of the form $\\log(x-a)$, the \"`a`s\"found following a method due to Trager and Lazard, and Rioboo, which is mentioned in the SymPy documentation as the method used.)\n\n\n#### Examples\n\n\nFind an antiderivative for $1/(x\\cdot(x^2+1)^2)$.\n\n\nWe have a partial fraction decomposition is:\n\n::: {.cell execution_count=12}\n``` {.julia .cell-code}\nq = (x * (x^2 + 1)^2)\napart(1/q)\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}{x^{2} + 1} - \\frac{x}{\\left(x^{2} + 1\\right)^{2}} + \\frac{1}{x}\n\\]\n</span>\n```\n:::\n:::\n\n\nWe see three terms. The first and second will be done by $u$-substitution, the third by a logarithm:\n\n::: {.cell execution_count=13}\n``` {.julia .cell-code}\nintegrate(1/q, 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\\log{\\left(x \\right)} - \\frac{\\log{\\left(x^{2} + 1 \\right)}}{2} + \\frac{1}{2 x^{2} + 2}\n\\]\n</span>\n```\n:::\n:::\n\n\n---\n\n\nFind an antiderivative of $1/(x^2 - 2x-3)$.\n\n\nWe again just let `SymPy` do the work. A partial fraction decomposition is given by:\n\n::: {.cell execution_count=14}\n``` {.julia .cell-code}\n𝒒 = (x^2 - 2x - 3)\napart(1/𝒒)\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{1}{4 \\left(x + 1\\right)} + \\frac{1}{4 \\left(x - 3\\right)}\n\\]\n</span>\n```\n:::\n:::\n\n\nWe see what should yield two logarithmic terms:\n\n::: {.cell execution_count=15}\n``` {.julia .cell-code}\nintegrate(1/𝒒, 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\\frac{\\log{\\left(x - 3 \\right)}}{4} - \\frac{\\log{\\left(x + 1 \\right)}}{4}\n\\]\n</span>\n```\n:::\n:::\n\n\n:::{.callout-note}\n## Note\n`SymPy` will find $\\log(x)$ as an antiderivative for $1/x$, but more generally, $\\log(\\lvert x\\rvert)$ is one.\n\n:::\n\n##### Example\n\n\nThe answers found can become quite involved. [Corless](https://arxiv.org/pdf/1712.01752.pdf), Moir, Maza, and Xie use this example which at first glance seems tame enough:\n\n::: {.cell execution_count=16}\n``` {.julia .cell-code}\nex = (x^2 - 1) / (x^4 + 5x^2 + 7)\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{x^{2} - 1}{x^{4} + 5 x^{2} + 7}\n\\]\n</span>\n```\n:::\n:::\n\n\nBut the integral is something best suited to a computer algebra system:\n\n::: {.cell execution_count=17}\n``` {.julia .cell-code}\nintegrate(ex, x)\n```\n\n::: {.cell-output .cell-output-display execution_count=18}\n```{=html}\n<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> \n\\[\n\\sqrt{\\frac{17}{84} + \\frac{13 \\sqrt{7}}{168}} \\log{\\left(x^{2} + x \\left(- \\frac{38 \\sqrt{6} \\sqrt{34 + 13 \\sqrt{7}}}{9} - \\frac{1301 \\sqrt{42} \\sqrt{34 + 13 \\sqrt{7}}}{1638} + \\frac{19 \\sqrt{42} \\sqrt{34 + 13 \\sqrt{7}} \\sqrt{884 \\sqrt{7} + 2339}}{546}\\right) - \\frac{2124092 \\sqrt{884 \\sqrt{7} + 2339}}{31941} - \\frac{9481 \\sqrt{7} \\sqrt{884 \\sqrt{7} + 2339}}{378} + \\frac{290246555}{63882} + \\frac{4221850 \\sqrt{7}}{2457} \\right)} - \\sqrt{\\frac{17}{84} + \\frac{13 \\sqrt{7}}{168}} \\log{\\left(x^{2} + x \\left(- \\frac{19 \\sqrt{42} \\sqrt{34 + 13 \\sqrt{7}} \\sqrt{884 \\sqrt{7} + 2339}}{546} + \\frac{1301 \\sqrt{42} \\sqrt{34 + 13 \\sqrt{7}}}{1638} + \\frac{38 \\sqrt{6} \\sqrt{34 + 13 \\sqrt{7}}}{9}\\right) - \\frac{2124092 \\sqrt{884 \\sqrt{7} + 2339}}{31941} - \\frac{9481 \\sqrt{7} \\sqrt{884 \\sqrt{7} + 2339}}{378} + \\frac{290246555}{63882} + \\frac{4221850 \\sqrt{7}}{2457} \\right)} + 2 \\sqrt{- \\frac{\\sqrt{884 \\sqrt{7} + 2339}}{84} + \\frac{17}{84} + \\frac{13 \\sqrt{7}}{56}} \\operatorname{atan}{\\left(\\frac{78 \\sqrt{42} x}{- 9 \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}} + 19 \\sqrt{884 \\sqrt{7} + 2339} \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}}} - \\frac{988 \\sqrt{7} \\sqrt{34 + 13 \\sqrt{7}}}{- 9 \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}} + 19 \\sqrt{884 \\sqrt{7} + 2339} \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}}} - \\frac{1301 \\sqrt{34 + 13 \\sqrt{7}}}{- 9 \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}} + 19 \\sqrt{884 \\sqrt{7} + 2339} \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}}} + \\frac{57 \\sqrt{34 + 13 \\sqrt{7}} \\sqrt{884 \\sqrt{7} + 2339}}{- 9 \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}} + 19 \\sqrt{884 \\sqrt{7} + 2339} \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}}} \\right)} + 2 \\sqrt{- \\frac{\\sqrt{884 \\sqrt{7} + 2339}}{84} + \\frac{17}{84} + \\frac{13 \\sqrt{7}}{56}} \\operatorname{atan}{\\left(\\frac{78 \\sqrt{42} x}{- 9 \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}} + 19 \\sqrt{884 \\sqrt{7} + 2339} \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}}} - \\frac{57 \\sqrt{34 + 13 \\sqrt{7}} \\sqrt{884 \\sqrt{7} + 2339}}{- 9 \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}} + 19 \\sqrt{884 \\sqrt{7} + 2339} \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}}} + \\frac{1301 \\sqrt{34 + 13 \\sqrt{7}}}{- 9 \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}} + 19 \\sqrt{884 \\sqrt{7} + 2339} \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}}} + \\frac{988 \\sqrt{7} \\sqrt{34 + 13 \\sqrt{7}}}{- 9 \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}} + 19 \\sqrt{884 \\sqrt{7} + 2339} \\sqrt{- 2 \\sqrt{884 \\sqrt{7} + 2339} + 34 + 39 \\sqrt{7}}} \\right)}\n\\]\n</span>\n```\n:::\n:::\n\n\n## Questions\n\n\n###### Question\n\n\nThe partial fraction decomposition of $1/(x(x-1))$ must be of the form $A/x + B/(x-1)$.\n\n\nWhat is $A$? (Use `SymPy` or just put the sum over a common denominator and solve for $A$ and $B$.)\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\" name='WeaveQuestion' data-id='qNik3CCS' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_qNik3CCS\">\n <div style=\"padding-top: 5px\">\n <div class=\"row\">\n <span style=\"width:90%\">\n <input id=\"qNik3CCS\" type=\"number\" class=\"form-control\" placeholder=\"Numeric answer\">\n </span>\n <span style=\"width:10%\">\n </span>\n</div>\n\n \n </div>\n </div>\n <div id='qNik3CCS_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.getElementById(\"qNik3CCS\").addEventListener(\"change\", function() {\n var correct = (Math.abs(this.value - -1) <= 0);\n var msgBox = document.getElementById('qNik3CCS_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_qNik3CCS\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_qNik3CCS\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n});\n\n</script>\n```\n:::\n:::\n\n\nWhat is $B$?\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\" name='WeaveQuestion' data-id='0szAuJyQ' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_0szAuJyQ\">\n <div style=\"padding-top: 5px\">\n <div class=\"row\">\n <span style=\"width:90%\">\n <input id=\"0szAuJyQ\" type=\"number\" class=\"form-control\" placeholder=\"Numeric answer\">\n </span>\n <span style=\"width:10%\">\n </span>\n</div>\n\n \n </div>\n </div>\n <div id='0szAuJyQ_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.getElementById(\"0szAuJyQ\").addEventListener(\"change\", function() {\n var correct = (Math.abs(this.value - 1) <= 0);\n var msgBox = document.getElementById('0szAuJyQ_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_0szAuJyQ\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_0szAuJyQ\")\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 following gives the partial fraction decomposition for a rational expression:\n\n\n\n$$\n\\frac{3x+5}{(1-2x)^2} = \\frac{A}{1-2x} + \\frac{B}{(1-2x)^2}.\n$$\n\n\nFind $A$ (being careful with the sign):\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\" name='WeaveQuestion' data-id='iQ9RaIZG' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_iQ9RaIZG\">\n <div style=\"padding-top: 5px\">\n <div class=\"row\">\n <span style=\"width:90%\">\n <input id=\"iQ9RaIZG\" type=\"number\" class=\"form-control\" placeholder=\"Numeric answer\">\n </span>\n <span style=\"width:10%\">\n </span>\n</div>\n\n \n </div>\n </div>\n <div id='iQ9RaIZG_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.getElementById(\"iQ9RaIZG\").addEventListener(\"change\", function() {\n var correct = (Math.abs(this.value - -1.5) <= 0.001);\n var msgBox = document.getElementById('iQ9RaIZG_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_iQ9RaIZG\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_iQ9RaIZG\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n});\n\n</script>\n```\n:::\n:::\n\n\nFind $B$:\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\" name='WeaveQuestion' data-id='zJS1zrpl' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_zJS1zrpl\">\n <div style=\"padding-top: 5px\">\n <div class=\"row\">\n <span style=\"width:90%\">\n <input id=\"zJS1zrpl\" type=\"number\" class=\"form-control\" placeholder=\"Numeric answer\">\n </span>\n <span style=\"width:10%\">\n </span>\n</div>\n\n \n </div>\n </div>\n <div id='zJS1zrpl_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.getElementById(\"zJS1zrpl\").addEventListener(\"change\", function() {\n var correct = (Math.abs(this.value - 6.5) <= 0.001);\n var msgBox = document.getElementById('zJS1zrpl_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_zJS1zrpl\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_zJS1zrpl\")\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 following specifies the general partial fraction decomposition for a rational expression:\n\n\n\n$$\n\\frac{1}{(x+1)(x-1)^2} = \\frac{A}{x+1} + \\frac{B}{x-1} + \\frac{C}{(x-1)^2}.\n$$\n\n\nFind $A$:\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\" name='WeaveQuestion' data-id='4L3PyKGT' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_4L3PyKGT\">\n <div style=\"padding-top: 5px\">\n <div class=\"row\">\n <span style=\"width:90%\">\n <input id=\"4L3PyKGT\" type=\"number\" class=\"form-control\" placeholder=\"Numeric answer\">\n </span>\n <span style=\"width:10%\">\n </span>\n</div>\n\n \n </div>\n </div>\n <div id='4L3PyKGT_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.getElementById(\"4L3PyKGT\").addEventListener(\"change\", function() {\n var correct = (Math.abs(this.value - 0.25) <= 0.001);\n var msgBox = document.getElementById('4L3PyKGT_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_4L3PyKGT\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_4L3PyKGT\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n});\n\n</script>\n```\n:::\n:::\n\n\nFind $B$:\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\" name='WeaveQuestion' data-id='wunZMztv' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_wunZMztv\">\n <div style=\"padding-top: 5px\">\n <div class=\"row\">\n <span style=\"width:90%\">\n <input id=\"wunZMztv\" type=\"number\" class=\"form-control\" placeholder=\"Numeric answer\">\n </span>\n <span style=\"width:10%\">\n </span>\n</div>\n\n \n </div>\n </div>\n <div id='wunZMztv_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.getElementById(\"wunZMztv\").addEventListener(\"change\", function() {\n var correct = (Math.abs(this.value - -0.25) <= 0.001);\n var msgBox = document.getElementById('wunZMztv_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_wunZMztv\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_wunZMztv\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n});\n\n</script>\n```\n:::\n:::\n\n\nFind $C$:\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\" name='WeaveQuestion' data-id='mJremwp7' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_mJremwp7\">\n <div style=\"padding-top: 5px\">\n <div class=\"row\">\n <span style=\"width:90%\">\n <input id=\"mJremwp7\" type=\"number\" class=\"form-control\" placeholder=\"Numeric answer\">\n </span>\n <span style=\"width:10%\">\n </span>\n</div>\n\n \n </div>\n </div>\n <div id='mJremwp7_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.getElementById(\"mJremwp7\").addEventListener(\"change\", function() {\n var correct = (Math.abs(this.value - 0.5) <= 0.001);\n var msgBox = document.getElementById('mJremwp7_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_mJremwp7\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_mJremwp7\")\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\nCompute the following exactly:\n\n\n\n$$\n\\int_0^1 \\frac{(x-2)(x-3)}{(x-4)^2\\cdot(x-5)} dx\n$$\n\n\nIs $-6\\log(5) - 5\\log(3) - 1/6 + 11\\log(4)$ the answer?\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\" name='WeaveQuestion' data-id='dgFYh6NH' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_dgFYh6NH\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_dgFYh6NH\"\n id=\"radio_dgFYh6NH_1\" value=\"1\">\n <span class=\"label-body\">\n Yes\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_dgFYh6NH\"\n id=\"radio_dgFYh6NH_2\" value=\"2\">\n <span class=\"label-body\">\n No\n </span>\n </input>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='dgFYh6NH_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_dgFYh6NH\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 1;\n var msgBox = document.getElementById('dgFYh6NH_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_dgFYh6NH\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_dgFYh6NH\")\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\nIn the assumptions for the partial fraction decomposition is the fact that $p(x)$ and $q(x)$ share no common factors. Suppose, this isn't the case and in fact we have:\n\n\n\n$$\n\\frac{p(x)}{q(x)} = \\frac{(x-c)^m s(x)}{(x-c)^n t(x)}.\n$$\n\n\nHere $s$ and $t$ are polynomials such that $s(c)$ and $t(c)$ are non-zero.\n\n\nIf $m > n$, then why can we cancel out the $(x-c)^n$ and not have a concern?\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\" name='WeaveQuestion' data-id='pGN3jVFb' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_pGN3jVFb\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_pGN3jVFb\"\n id=\"radio_pGN3jVFb_1\" value=\"1\">\n <span class=\"label-body\">\n <code>SymPy</code> allows it.\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_pGN3jVFb\"\n id=\"radio_pGN3jVFb_2\" value=\"2\">\n <span class=\"label-body\">\n The value \\(c\\) is a removable singularity, so the integral will be identical.\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_pGN3jVFb\"\n id=\"radio_pGN3jVFb_3\" value=\"3\">\n <span class=\"label-body\">\n The resulting function has an identical domain and is equivalent for all \\(x\\).\n </span>\n </input>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='pGN3jVFb_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_pGN3jVFb\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 2;\n var msgBox = document.getElementById('pGN3jVFb_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_pGN3jVFb\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_pGN3jVFb\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\nIf $m = n$, then why can we cancel out the $(x-c)^n$ and not have a concern?\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\" name='WeaveQuestion' data-id='lBWR3i77' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_lBWR3i77\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_lBWR3i77\"\n id=\"radio_lBWR3i77_1\" value=\"1\">\n <span class=\"label-body\">\n <code>SymPy</code> allows it.\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_lBWR3i77\"\n id=\"radio_lBWR3i77_2\" value=\"2\">\n <span class=\"label-body\">\n The value \\(c\\) is a removable singularity, so the integral will be identical.\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_lBWR3i77\"\n id=\"radio_lBWR3i77_3\" value=\"3\">\n <span class=\"label-body\">\n The resulting function has an identical domain and is equivalent for all \\(x\\).\n </span>\n </input>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='lBWR3i77_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_lBWR3i77\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 2;\n var msgBox = document.getElementById('lBWR3i77_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_lBWR3i77\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_lBWR3i77\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\nIf $m < n$, then why can we cancel out the $(x-c)^n$ and not have a concern?\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\" name='WeaveQuestion' data-id='8v9FMnpm' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_8v9FMnpm\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_8v9FMnpm\"\n id=\"radio_8v9FMnpm_1\" value=\"1\">\n <span class=\"label-body\">\n <code>SymPy</code> allows it.\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_8v9FMnpm\"\n id=\"radio_8v9FMnpm_2\" value=\"2\">\n <span class=\"label-body\">\n The value \\(c\\) is a removable singularity, so the integral will be identical.\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_8v9FMnpm\"\n id=\"radio_8v9FMnpm_3\" value=\"3\">\n <span class=\"label-body\">\n The resulting function has an identical domain and is equivalent for all \\(x\\).\n </span>\n </input>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='8v9FMnpm_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_8v9FMnpm\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 3;\n var msgBox = document.getElementById('8v9FMnpm_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_8v9FMnpm\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_8v9FMnpm\")\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 partial fraction decomposition, as presented, factors the denominator polynomial into linear and quadratic factors over the real numbers. Alternatively, factoring over the complex numbers is possible, resulting in terms like:\n\n\n\n$$\n\\frac{a + ib}{x - (\\alpha + i \\beta)} + \\frac{a - ib}{x - (\\alpha - i \\beta)}\n$$\n\n\nHow to see that these give rise to real answers on integration is the point of this question.\n\n\nBreaking the terms up over $a$ and $b$ we have:\n\n\n\n$$\n\\begin{align*}\nI &= \\frac{a}{x - (\\alpha + i \\beta)} + \\frac{a}{x - (\\alpha - i \\beta)} \\\\\nII &= i\\frac{b}{x - (\\alpha + i \\beta)} - i\\frac{b}{x - (\\alpha - i \\beta)}\n\\end{align*}\n$$\n\n\nIntegrating $I$ leads to two logarithmic terms, which are combined to give:\n\n\n\n$$\n\\int I dx = a\\cdot \\log((x-(\\alpha+i\\beta)) \\cdot (x - (\\alpha-i\\beta)))\n$$\n\n\nThis involves no complex numbers, as:\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\" name='WeaveQuestion' data-id='JNyv8TN2' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_JNyv8TN2\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_JNyv8TN2\"\n id=\"radio_JNyv8TN2_1\" value=\"1\">\n <span class=\"label-body\">\n The \\(\\beta\\) are \\(0\\), as the polynomials in question are real\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_JNyv8TN2\"\n id=\"radio_JNyv8TN2_2\" value=\"2\">\n <span class=\"label-body\">\n The complex numbers are complex conjugates, so the term in the logarithm will simply be \\(x - 2\\alpha x + \\alpha^2 + \\beta^2\\)\n </span>\n </input>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='JNyv8TN2_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_JNyv8TN2\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 2;\n var msgBox = document.getElementById('JNyv8TN2_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_JNyv8TN2\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_JNyv8TN2\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\nThe term $II$ benefits from this computation (attributed to Rioboo by [Corless et. al](https://arxiv.org/pdf/1712.01752.pdf))\n\n\n\n$$\n\\frac{d}{dx} i \\log(\\frac{X+iY}{X-iY}) = 2\\frac{d}{dx}\\arctan(\\frac{X}{Y})\n$$\n\n\nApplying this with $X=x - \\alpha$ and $Y=-\\beta$ shows that $\\int II dx$ will be\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\" name='WeaveQuestion' data-id='DwvDqAey' data-controltype=''>\n <div class='form-group '>\n <div class='controls'>\n <div class=\"form-floating input-group\" id=\"controls_DwvDqAey\">\n <div style=\"padding-top: 5px\">\n <div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_DwvDqAey\"\n id=\"radio_DwvDqAey_1\" value=\"1\">\n <span class=\"label-body\">\n \\(-2b\\arctan((x - \\alpha)/(\\beta))\\)\n </span>\n </input>\n </label>\n</div>\n<div class=\"form-check\">\n <label>\n <input class=\"form-check-input\" type=\"radio\" name=\"radio_DwvDqAey\"\n id=\"radio_DwvDqAey_2\" value=\"2\">\n <span class=\"label-body\">\n \\(2b\\sec^2(-(x-\\alpha)/(-\\beta))\\)\n </span>\n </input>\n </label>\n</div>\n\n \n </div>\n </div>\n <div id='DwvDqAey_message' style=\"padding-bottom: 15px\"></div>\n </div>\n </div>\n</form>\n\n<script text='text/javascript'>\ndocument.querySelectorAll('input[name=\"radio_DwvDqAey\"]').forEach(function(rb) {\nrb.addEventListener(\"change\", function() {\n var correct = rb.value == 1;\n var msgBox = document.getElementById('DwvDqAey_message');\n if(correct) {\n msgBox.innerHTML = \"<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>\";\n var explanation = document.getElementById(\"explanation_DwvDqAey\")\n if (explanation != null) {\n explanation.style.display = \"none\";\n }\n } else {\n msgBox.innerHTML = \"<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>\";\n var explanation = document.getElementById(\"explanation_DwvDqAey\")\n if (explanation != null) {\n explanation.style.display = \"block\";\n }\n }\n\n})});\n\n</script>\n```\n:::\n:::\n\n\n",
"supporting": [
"partial_fractions_files/figure-html"
],
"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"
]
}
}
}