\input homework_macros.tex

%\distiller
\printer
\def\dd #1#2{\frac{d#1}{d#2}}
\def\Frac#1#2{\frac{\displaystyle #1}{\displaystyle #2}}
\def\vln#1{\ln\vert#1\vert}
\SN{\jobname}

\pn1.$\Frac{5x-13}{(x-3)(x-2)}=\Frac A{x-3}+\Frac B{x-2}$:
$5x-13=A(x-2)+B(x-3)$: plug in $x=2$, $-3=B(-1)$ or $B=3$;
plug in $x=3$, $2=A(1)$ or
$\Frac{5x-3}{(x-3)(x-2)}=\Frac {2}{x-3}+\Frac {3}{x-2}$.

\pn5.$\Frac{z+1}{z^2(z-1)}=\Frac Az+\Frac B{z^2}+\Frac C{z-1}$:
$z+1=A z(z-1)+B(z-1)+Cz^2$.
Plug in $z=0$, $1=B(-1)$  so $B=-1$. 
Take derivative and plug in  $z=0$;
$1= A (-1)+B$ so $A=-2$.
Plug in $z=1$; $2=C(1)^2$ so $C=2$ and
$\Frac{z+1}{z^2(z-1)}=\Frac {-2}z+\Frac {-1}{z^2}+\Frac 2{z-1}$.

\pn7.$\Frac{t^2+8}{t^2-5t+6}$.
First note that degree of numerator equals degree of denominator
so polynomial long division needs to be used:
$\Frac{t^2+8}{t^2-5t+6}=1+\Frac{5t+2}{t^2-5t+6}$.
The denominator is reducible, $t^2-5t+6=(t-2)(t-3)$;
$\Frac{5t+2}{t^2-5t+6}=\Frac A{t-2}+\Frac B{t-3}$ or
$5t+2=A(t-3)+B(t-2)$.
Plug in $t=2$; $12=A(-1)$ so $A=-12$.
Plug in $t=3$; $17=B(1)$ so $B=17$.
Hence
$\Frac{t^2+8}{t^2-5t+6}=1+\Frac{-12}{t-2}+\Frac{17}{t-3}$.

\pn11.$\int\Frac{x+4}{x^2+5x-6}\>dx$.
Apply partial fractions to the integrand.
The quadratic is reducible $x^2+5x-6=(x+6)(x-1)$ so
$\Frac{x+4}{x^2+5x-6}=\Frac A{x+6}+\Frac{B}{x-1}$ or
$x+4=A(x-1)+B(x+6)$.
Plug in $x=1$; $5=B(7)$ so $B=\frac57$.
Plug in $x=-6$; $-2=A(-7)$ so $A=\frac27$ and
$\Frac{x+4}{x^2+5x-6}=\frac17\br2{\Frac 2{x+6}+\Frac 5{x-1}}$.
Hence 
$\int\Frac{x+4}{x^2+5x-6}\>dx=\frac27\int\frac{dx}{x+6}+
\frac57\int\frac{dx}{x-1}=\frac27\vln{x+6}+\frac 57\vln{x-1}+C$.

\pn17.$\int^1_0\Frac{x^3dx}{x^2+2x+1}$.
Apply partial fractions to the integrand.
First do polynomial long division:
$\Frac{x^3}{x^2+2x+1}=x-2+\Frac{3x+2}{x^2+2x+1}$.
The quadratic is reducible $x^2+2x+1=(x+1)^2$ so
$\Frac{3x+2}{x^2+2x+1}=\Frac A{x+1}+\Frac B{(x+1)^2}$ or
$3x+2=A(x+1)+B$.
Plug in $x=-1$, $-1=B$.
Take derivatives, $3=A$.
Hence 
$\int^1_0\Frac{x^3dx}{x^2+2x+1}=
\int^1_0 (x-2)\>dx+\int^1_0\Frac{3dx}{x+1}+\int^1_0\Frac{-dx}{(x+1)^2}=
\Frac{x^2}{2}\Big\vert^1_0-2x\Big\vert^1_0+3\vln{x+1}\Big\vert^1_0
-\Frac{(x+1)^{-1}}{-1}\Big\vert^1_0=
\frac12-0-(2-0)+3(\ln2-\ln1)-\br1{-\frac12-(-1)}=
\frac 12-2+3\ln2+\frac12-1=3\ln2\>- 2$.


\pn21.$\int^1_0\Frac{dx}{(x+1)(x^2+1)}$.
Partial fractions,
$\Frac{1}{(x+1)(x^2+1)}=\Frac A{x+1}+\Frac{Bx+C}{x^2+1}$ or
$1=A(x^2+1)+(Bx+C)(x+1)$.
Plug in $x=-1$; $1=A\br1{(-1)^1+1}$ or $A=\frac12$.
Plug in $x=0$; $1=A(1)+C(1)$ so $C=\frac12$.
Plug in $x=1$; $1=A(2)+(B+C)(2)$ so $1=1+2B+1$ or $B=-\frac12$.
Hence 
$\int^1_0\Frac{dx}{(x+1)(x^2+1)}=
\frac12\int^1_0\Frac{dx}{x+1}-\frac12\int^1_0\Frac{x-1}{x^2+1} dx$
Work on $\int^1_0\Frac{x-1}{x^2+1}dx=
\int^1_0\Frac{xdx}{x^2+1}+\int^1_0\Frac{dx}{x^2+1}$.
Work on $\int^1_0\Frac{xdx}{x^2+1}$ by substituting
$u=x^2+1$ $du=2xdx$ so
$\int^1_0\Frac{xdx}{x^2+1}=\frac12\int^2_1\Frac{du}{u}=
\frac12\vln u\Big\vert^2_1=\frac12\ln2$.
$\int^1_0\Frac{dx}{x^2+1}=\arctan x\Big\vert^1_0=
\arctan 1-\arctan 0=\frac\pi4-0$, so
$\int^1_0\Frac{x-1}{x^2+1}dx=\frac12\ln2+\frac\pi4$.
Finally
$\int^1_0\Frac{dx}{(x+1)(x^2+1)}=
\frac12\int^1_0\Frac{dx}{x+1}-\frac12\br1{\frac{\ln2}2+\frac\pi4}=
\frac12\vln{x+1}\Big\vert^1_0-\frac{\ln2}{4}+\frac\pi8
=\frac12\ln2-\frac{\ln2}{4}-\frac\pi8=
\frac{\ln2}{4}+\frac\pi8$.

\pn25.$\int\Frac{2s+2}{(s^2+1)(s-1)^3}ds$.
Partial fractions yields
$\Frac{2s+2}{(s^2+1)(s-1)^3}=\Frac A{s-1}+\Frac B{(s-1)^2}+
\Frac C{(s-1)^3}+\Frac{Ds+E}{s^2+1}$ or
$2s+2=A(s-1)^2(s^2+1)+B(s-1)(s^2+1)+C(s^2+1)+(Ds+E)(s-1)^3$.
Plug in $s=1$; $4=C(2)$ so $C=2$.
Hence $2s+2-2s^2-2=A(s-1)^2(s^2+1)+B(s-1)(s^2+1)+(Ds+E)(s-1)^3$
and we can divide both sides by $s-1$ to get
$-2s=A(s-1)(s^2+1)+B(s^2+1)+(Ds+E)(s-1)^2$.
Plug in $s=1$ again;
$-2=B(2)$ so $B=-1$.
Again
$-2s+(s^2+1)=A(s-1)(s^2+1)+(Ds+E)(s-1)^2$.
Divide by $s-1$ again to get
$s-1=A(s^2+1)+(Ds+E)(s-1)$.
Plug in $s=1$ again; $0=A(2)$ so $A=0$.
Divide by $s-1$ again to get
$1=Ds+E$ so $D=0$ and $E=1$.
Thus
$\Frac{2s+2}{(s^2+1)(s-1)^3}=\Frac{-1}{(s-1)^2}+
\Frac{2}{(s-1)^3}+\Frac{1}{s^2+1}$.
Then
$\int\Frac{2s+2}{(s^2+1)(s-1)^3}=
-\int\Frac{ds}{(s-1)^2}+
2\int\Frac{ds}{(s-1)^3}+
\int\Frac{ds}{s^2+1}=
-\Frac{(s-1)^{-1}}{-1}+2\br2{\Frac{(s-1)^{-2}}{-2}}+\arctan s+C=
\Frac 1{s-1}-\Frac{1}{(s-1)^2}+\arctan s+C$.

\pn29.$\int\Frac{2x^3-2x^2+1}{x^2-x}\>dx$.
To apply partial fractions, we first need to do polynomial
long division:
$\Frac{2x^3-2x^2+1}{x^2-x}=2x+\Frac{1}{x^2-x}$.
$\Frac{1}{x^2-x}=\Frac Ax+\Frac B{x-1}$ or
$1=A(x-1)+Bx$.
Plug in $x=1$; $1=B$.
Plug in $x=0$; $1=A(-1)$ so $A=-1$.
Hence 
$\int\Frac{2x^3-2x^2+1}{x^2-x}\>dx=
\int2x\>dx-\int\Frac{dx}{x}+\int\Frac{dx}{x-1}=
x^2-\vln x+\vln{x-1}+C$.

\pn33.$\int\Frac{y^4+y^2-1}{y^3+y}dy$
Applying polynomial long division
$\Frac{y^4+y^2-1}{y^3+y}=y-\Frac{1}{y^3+y}$ and
$\Frac1{y^3+y}=\Frac Ay+\Frac{(By+C)}{y^2+1}$ or
$1=A(y^2+1)+(By+C)y$.
Plug in $y=0$; $1=A(1)$ so $A=1$.
Then $1-(y^2+1)=(By+C)y$ or
$-y^2=(By+C)y$.
Hence $By+C=-y$ so $B=-1$ and $C=0$.
$\int\Frac{y^4+y^2-1}{y^3+y}dy=
\int y\>dy-\br2{\int\Frac{dy}{y}-\int\Frac{y\>dy}{y^2+1}}=
\Frac{y^2}2-\br1{\vln y-\frac12\vln{y^2+1}}+C=
\Frac{y^2}2-\vln y+\frac12\vln{y^2+1}+C$.

\pn35.$\int\Frac{e^t\>dt}{e^{2t}+3e^t+2}$.
Substitute $u=e^t$, $du=e^tdt$ so
$\int\Frac{e^t\>dt}{e^{2t}+3e^t+2}=
\int\Frac{du}{u^2+3u+2}=
\int\Frac{du}{\br2{u+\frac32}^2-\frac14}$.
Substitute again $\frac12w=\br1{u+\frac32}$,
$\frac12 dw=du$ or $\frac12 dw=du$.
Hence 
$\int\Frac{du}{\br2{u+\frac32}^2-\frac14}=
\int\Frac{\frac12 dw}{\frac 14 w^2-\frac14}=
\int\Frac{2dw}{w^2-1}=\int\Frac{dw}{w-1}-
\int\Frac{dw}{w+1}=
\vln{w-1}-\vln{w+1}+C=\Big\vert\Frac{w-1}{w+1}\Big\vert+C$.
Working back,
$\Big\vert\Frac{w-1}{w+1}\Big\vert=
\Bigg\vert\Frac{2\br1{u+\frac32}-1}
{2\br1{u+\frac32}+1}\Bigg\vert+C=
\Big\vert\Frac{2u+2}{2u+4}\Big\vert+C=
\Big\vert\Frac{u+1}{u+2}\Big\vert+C=
\Big\vert\Frac{e^t+1}{e^t+2}\Big\vert+C$.


\pn39.$\int\Frac{(x-2)^2\arctan(2x)-12x^3-3x}{(4x^2+1)(x-2)^2}\>dx=
\int\Frac{(x-2)^2\arctan(2x)}{(4x^2+1)(x-2)^2}\>dx
\int\Frac{-12x^3-3x}{(4x^2+1)(x-2)^2}\>dx=
\int\Frac{\arctan(2x)}{(4x^2+1)}\>dx
-3\int\Frac{4x^3+x}{(4x^2+1)(x-2)^2}\>dx$.
First do $\int\Frac{\arctan(2x)}{(4x^2+1)}\>dx$ by substitution
$w=\arctan(2x)$, $dw=\Frac{2dx}{(2x)^2+1}$
so
$\int\Frac{\arctan(2x)}{(4x^2+1)}\>dx=\frac12\int w\>dw=
\frac12\frac{w^2}2+C=\frac{w^2}4+C=\frac{\br1{\arctan(2x)}^2}{4}+C$.
Now do $\int\Frac{4x^3+x}{(4x^2+1)(x-2)^2}\>dx=
\int\Frac{x}{(x-2)^2}\>dx$
by partial fractions:
$\Frac{x}{(x-2)^2}=\Frac A{x-2}+\Frac B{(x-2)^2}$ or
$x=A(x-2)+B$.
Plug in $x=2$; $2=B$.
Hence
$x-2=A(x-2)$ or $A=1$.
Hence
$\int\Frac{x}{(x-2)^2}\>dx=\int\Frac{dx}{x-2}+2\int\Frac{dx}{(x-2)^2}=
\vln{x-2}+2\Frac{(x-2)^{-1}}{-1}+C=
\vln{x-2}-\Frac{2}{x-2}+C$.
Finally
$\int\Frac{(x-2)^2\arctan(2x)-12x^3-3x}{(4x^2+1)(x-2)^2}\>dx=
\br2{\frac{\br1{\arctan(2x)}^2}{4}}-3\br2{\vln{x-2}-\Frac{2}{x-2}}+C=
\frac{\br1{\arctan(2x)}^2}{4}-3\vln{x-2}+\Frac{6}{x-2}+C$.

\pn43.$(t^2+2t)\dd xt=2x+2$ $(t, x >0)$, $x(1)=1$.
First work on the differential equation by separation of variables:
$\Frac{dx}{2x+2}=\Frac{dt}{t^2+2t}$.
Integrating we get
$\int\Frac{dx}{2x+2}=\int\Frac{dt}{t^2+2t}$.
First $\int\Frac{dx}{2x+2}=\frac12\vln{x+1}+C$.
Then by partial fractions
$\int\Frac{dt}{t^2+2t}=-\frac12\int\Frac{dt}{t+2}+\frac12\int\Frac{dt}{t}=
-\frac12\vln{t+2}+\frac12\vln t+C$ so we get
$\frac12\vln{x+1}=-\frac12\vln{t+2}+\frac12\vln t+C$
and our next task is to solve for $x$ as a function of $t$ if we can do it.
$\vln{x+1}=\vln t-\vln{t+2}+C_0$ so
$x+1=A_0\Frac{t}{t+2}$ or
$x=A_0\Frac{t}{t+2}-1$.
Finally, since $x(1)=1$
$1=A_0\Frac{1}{1+2}-1$ or
$1=A_0\frac13 -1$ so $A_0\frac13=2$ or $A_0=6$ and
$x=\Frac{6t}{t+2}-1$ or $x=\Frac{5t-2}{t+2}$.

\end