Skip to main content

Coordinated Differential Equations

Section A.1 Brief review

Subsection A.1.1 Completing the Square

First, let’s focus on completing the square when the \(x^2\) coefficient is 1, i.e., a situation like \(x^2+bx+c\text{.}\) The steps are as follows:
  • Take the \(x\) coefficient, cut it in half, and square it, so \(b\) turns to \((b/2)^2\text{.}\)
  • Add and subtract this new number \((b/2)^2\) to the expression, after the \(x\) term but before the constant term, obtaining \(x^2+bx+(b/2)^2-(b/2)^2+c\text{.}\)
  • The first three terms can be factored as \((x + \frac{b}{2})^2\text{.}\) The constants at the end combine into a single term.

Example A.1.1.

Complete the square on the expression \(x^2 + 5x + 9\text{.}\)
We start by taking the \(x\) coefficient, \(5\text{,}\) and cut it in half and square it, obtaining \(\frac{25}{4}\text{.}\) We then add and subtract this term between the \(x\) term and the constant, obtaining
\begin{equation*} x^2 + 5x + \frac{25}{4} - \frac{25}{4} + 9 \end{equation*}
The first three terms factor; in this case we take \(5\) and cut it in half, and that tells us what to add to \(x\) that is squared. We obtain
\begin{equation*} x^2 + 5x + 9 = x^2 + 5x + \frac{25}{4} - \frac{25}{4} + 9 = (x + \frac52)^2 + \frac{11}{4} \end{equation*}
If the \(x^2\) coefficient is not equal to 1, we factor out the coefficient, complete the square of the part inside parenthesis as usual, and distribute the coefficient again.

Example A.1.2.

Complete the square on the expression \(4t^2 - 32t + 10\)
The \(t^2\) coefficient is \(4\text{,}\) so we factor it out and get \(4(t^2 - 16t + \frac52)\text{;}\) we then use the standard completing the square technique on \(t^2 - 16t + \frac52\text{.}\) The first step is adding and subtracting \((\frac{-16}{2})^2 = 64\text{;}\) doing this and factoring gives
\begin{equation*} t^2 - 16t + \frac52 = t^2 - 16t + 64 - 64 + \frac52 = (t - 8)^2 - \frac{123}{2} \end{equation*}
Then we multiply this by \(4\) to obtain
\begin{equation*} 4t^2 - 32t + 10 = 4((t-8)^2 - \frac{123}{2}) = 4(t - 8)^2 - 246 \end{equation*}

Subsection A.1.2 Solving Quadratic Equations

There are various ways to solve quadratic functions. Factoring works when the roots are rational numbers. Graphing works if an approximate answer suffices. Completing the square and the quadratic formula will always work. The previous subsection details how to complete the square; here, we review the quadratic formula.
If one has a quadratic equation of the form \(ax^2 + bx + c\text{,}\) with \(a \ne 0\text{,}\) the solutions are given as
\begin{equation*} x = \frac{-b \pm \sqrt{b^2-4ac}}{2a} \end{equation*}

Example A.1.3.

Solve the quadratic equation \(x^2 - 4x = 2\)
Rearranging this to equal zero gives \(x^2 - 4x - 2 = 0\text{,}\) and we thus have \(a = 1, b = -4, c = -2\text{.}\) The solutions are
\begin{equation*} x = \frac{-(-4) \pm \sqrt{(-4)^2 - 4(1)(-2)}}{2(1)} = \frac{4 \pm \sqrt{24}}{2}=\frac{4\pm2\sqrt{6}}{2}=2\pm\sqrt{6} \end{equation*}
Sometimes there are no real solutions, but there are always complex solutions, as shown in the example below.

Example A.1.4.

Solve the quadratic equation \(2x^2-12x+27=0\text{.}\)
We have \(a = 2, b = -12, c = 27\text{;}\) plugging this in the quadratic formula gives
\begin{equation*} x = \frac{12 \pm \sqrt{144-4(2)(27)}}{2(2)} = \frac{12\pm\sqrt{-72}}{4} \end{equation*}
We can write
\begin{equation*} \sqrt{-72}=i\sqrt{72}=6\sqrt{2}i \end{equation*}
So
\begin{equation*} x = \frac{12\pm6\sqrt{2}i}{4} = 3 \pm \frac{3\sqrt{2}}{2}i \end{equation*}

Subsection A.1.3 Solving \(2 \times 2\) linear systems

A \(2 \times 2\) linear system is a set of equations of the form
\begin{align*} a_{11}x + a_{12}y \amp = b_1 \\ a_{21}x + a_{22}y \amp = b_2 \end{align*}
where \(a_{11}, a_{12}, a_{21}, a_{22}, b_1,\) and \(b_2\) are constants, and \(x, y\) are variables to be solved for. A system can have one unique solution, no solutions, or infinitely many solutions.
There are many methods to solve systems of equations, but the most common ones (which will be reviewed here) are substitution and elimination. The first example below shows how to use substitution, and the second shows how to use elimination.

Example A.1.5.

Solve the following system of equations using substitution.
\begin{align*} 2x + 3y \amp = 5\\ -4x + 2y \amp = 2 \end{align*}
We can use either equation to solve for either variable; let’s use the first equation to solve for \(y\text{.}\) We get \(y = \frac{5-2x}{3}\text{.}\) We then plug this into the second equation to obtain
\begin{equation*} -4x + 2\cdot\frac{5-2x}{3} = 2 \end{equation*}
Simplifying the equation gives \(\frac{-16}{3}x+\frac{10}{3} = 2\text{;}\) solving this yields \(x = \frac14\text{;}\) plugging this into \(y = \frac{5-2x}{3}\) yields \(y = \frac32\text{.}\)

Example A.1.6.

Solve the following system of equations using elimination.
\begin{align*} 3x + 5y \amp = 2 \\ 2x + 4y \amp = 3 \end{align*}
We want to multiply each equation by something and add them together so that one variable cancels with itself. The \(x\) coefficients are \(3\) and \(2\text{;}\) if we multiply the first equation by \(-2\) and the second by \(3\) we get a \(6x\) and a \(-6x\) which will cancel when added.
Doing this, the first equation becomes \(-2(3x + 5y = 2) \to -6x - 10y = -4\) and the second equation becomes \(3(2x + 4y = 3) \to 6x + 12y = 9\text{;}\) adding these equations yields
\begin{equation*} -6x - 10y + 6x + 12y = -4 + 9 \end{equation*}
\begin{equation*} 2y = 5 \to y = \frac52 \end{equation*}
Then we can plug this into the equation \(3x + 5y = 2\) to get \(x = \frac{-7}{2}\) .
Sometimes a system will have infinitely many solutions, or none at all. The following examples show what happens when you try to solve them.

Example A.1.7.

Solve the system of equations
\begin{align*} x - 2y \amp = 2\\ -2x + 4y \amp = 1 \end{align*}
Using substiting, the first equation tells us that \(x = 2 + 2y\text{,}\) and plugging this into the second equation gives \(-2(2 + 2y) + 4y = 1\text{,}\) which simplifies to \(-4 = 1\text{.}\) This obvious falsehood means there are no solutions.

Example A.1.8.

Solve the system of equations
\begin{align*} 2x + 4y \amp = -6 \\ 3x + 6y \amp = -9 \end{align*}
If we try to eliminate the \(x\) variable, we can multiply the first equation by \(-3\) and the second by \(2\text{,}\) giving \(-6x - 12y = 18\) and \(6x + 12y = -18\text{;}\) adding these together gives \(0 = 0\text{.}\) This tells us there are infinitely many solutions; to find them, we can take either equation and solve for one of the variables. The first one gives \(x = -3-2y\text{,}\) and this is the full set. (That is, to find a solution, you can let \(y\) be whatever you want, and then use \(x = -3-2y\) to solve for \(x\text{.}\))

Subsection A.1.4 Basic derivatives

Below is a chart showing derivatives of common functions; make sure you know these rules. You can also condier reviewing computing derivatives of sine and cosine functions
 1 
mathbooks.unl.edu
Table A.1.9. Table of basic derivatives
\(f(x)\) \(f'(x)\)
\(c\) \(0\)
\(cx\) \(c\)
\(x^n\) \(nx^{n-1}\)
\(\frac1x\) \(\frac{-1}{x^2}\)
\(\sqrt{x}\) \(\frac{1}{2\sqrt{x}}\)
\(\sin(x)\) \(\cos(x)\)
\(\cos(x)\) \(-\sin(x)\)
\(\tan(x)\) \(\sec^2(x)\)
\(e^x\) \(e^x\)
\(\ln(x)\) \(\frac{1}{x}\)
\(f(x)\pm g(x)\) \(f'(x) \pm g'(x)\)
\(c\cdot f(x)\) \(c\cdot f'(x)\)
\(f(x)g(x)\) \(f(x)g'(x) + f'(x)g(x)\)
\(\frac{f(x)}{g(x)}\) \(\frac{g(x)f'(x)-f(x)g(x)}{g(x)^2}\)
\(f(g(x))\) \(f'(g(x))\cdot g'(x)\)
We can also take partial derivatives of functions of multiple variables, like \(3x^2 + 2y\text{.}\) Below are two examples of this.

Example A.1.10.

Compute \(\frac{\partial}{\partial x}(-3x^2y^2 + \sin(2x - y))\)
The "\(\frac{\partial}{\partial x}\)" part means we are taking the partial derivative with respect to \(x\text{,}\) treating \(y\) as a constant. The derivative of \(-3x^2\) is \(-6x\text{,}\) so the first term becomes \(-6xy^2\text{.}\) Then the derivative of \(\sin(2x - y)\text{,}\) treating \(x\) as a variable and \(y\) as a constant, is \(2\cos(2x-y)\text{.}\) The final answer is \(-6xy^2 + 2\cos(2x-y)\text{.}\)

Example A.1.11.

Compute \(\frac{\partial}{\partial y}(\frac{x+y}{y} - xy^4)\)
The "\(\frac{\partial}{\partial y}\)" part means we are taking the derivative with respect to \(y\text{,}\) treating \(x\) as a constant, as if it were "\(2\)" or "\(\pi\)". The quotient rule on the first part means we have \(\frac{y(1)-(x+y)(1)}{y^2}\text{.}\) Then since the derivative of \(-y^4\) is \(-4y^3\text{,}\) so the second term turns to \(-4xy^3\text{.}\) The final answer is \(\frac{-x}{y^2} - 4xy^3\text{.}\)

Subsection A.1.5 Basic integrals

Below is a chart showing integrals of common functions; make sure you know these rules. In differential equations, it is extra important that you remember the "+C" when taking integrals, since you will be finding solutions to differential equations that depend on the value of C.
Table A.1.12. Table of basic integrals
\(f(x)\) \(\int f(x) dx\)
\(a\) \(ax+C\)
\(x^n, n \ne -1\) \(\frac{x^{n+1}}{n+1}+C\)
\(\frac1x\) \(\ln|x| + C\)
\(\sin(x)\) \(-\cos(x)+C\)
\(\cos(x)\) \(\sin(x)+C\)
\(\frac{1}{x^2+1}\) \(\arctan(x)+C\)
\(f(x)\pm g(x)\) \(\int f(x)dx \pm \int g(x)dx\)
\(c\cdot f(x)\) \(c\cdot \int f(x)dx\)

Subsection A.1.6 Integration by u-substitution

Integration by u-substition is the inverse of the chain rule for derivatives. What this does is changes the variables to make integration easier. Below are some examples.

Example A.1.13.

Compute \(\int e^x(2e^x + 1)^2 dx\)
We want \(u\) to be something whose derivative appears (or has something similar to it appearing) elsewhere in the integral. Notice that the derivative of \(2e^x+1\) is \(2e^x\) which is the same as the \(e^x\) at the front, except there’s an extra factor of \(2\text{.}\) Therefore \(u = 2e^x + 1\) is probably the best choice.
With this, we compute the derivative and write \(du = 2e^x dx\text{,}\) and solving for \(dx\) gives \(dx = \frac{du}{2e^x}\text{.}\) Substiting our values of \(x\) and \(dx\) gives
\begin{equation*} \int e^x(2e^x+1)^2 \, dx = \int e^xu^2 \frac{du}{2e^x} \, dx = \int \frac{u^2}{2} du = \frac{u^3}{6} + C \end{equation*}
Substituting back in \(u = 2e^x+1\) the final answer is
\begin{equation*} \frac{u^3}{3}+C = \frac{(2e^x+1)^3}{6}+C \end{equation*}

Example A.1.14.

Compute \(\int \frac{\sin(x)}{\cos(x)+1} \,dx\)
We want \(u\) to be something whose derivative appears elsewhere in the expression. It looks like \(u=\sin(x)\) and \(u=\cos(x)+1\) work in this regard, but it’s best not to have the derivative of \(u\) appear in the denominator of a fraction, so \(u = \cos(x)+1\) is probably a better choice. We then have \(du = -\sin(x) dx\) so \(dx = -\frac{du}{\sin(x)}\text{.}\) Therefore,
\begin{equation*} \int \frac{\sin(x)}{\cos(x)+1} \, dx = \int \frac{\sin(x)}{u}\cdot \frac{-du}{\sin(x)} = \int \frac{-1}{u} \, du = -\ln|u| +C \end{equation*}
\begin{equation*} = -\ln|\cos(x)+1|+C \end{equation*}
If we are asked to evaluate a definite integral, it is possible to do so entirely in the u-world without having to convert back to the x-world, as the examples below show.

Example A.1.15.

Compute \(\int_{\pi^2/4}^{\pi^2}\frac{\sin(\sqrt{x})}{\sqrt{x}} \, dx\)
We substitute \(u = \sqrt{x}\text{,}\) which gives \(du = \frac{1}{2\sqrt{x}}dx\) so \(dx = 2\sqrt{x}du\text{.}\) Also, the bounds of the integral go from \(x = \frac{\pi^2}{4}\) to \(x = \pi^2\text{;}\) the substitution means the integral now goes from \(u = \frac{\pi}{2}\) to \(u = \pi\text{.}\) We therefore get
\begin{equation*} \int_{\pi^2/4}^{\pi^2}\frac{\sin(\sqrt{x})}{\sqrt{x}} \, dx = \int_{\pi/2}^{\pi}\frac{\sin(u)}{\sqrt{x}}\cdot 2\sqrt{x}du = \int_{\pi/2}^{\pi}2\sin(u)\, du \end{equation*}
\begin{equation*} = -2\cos(\pi)+2\cos(\frac{\pi}{2}) = 2 \end{equation*}

Example A.1.16.

Compute \(\int_3^7\sqrt{\frac{x-1}{2}}\, dx\text{.}\)
Substituting \(u = \frac{x-1}{2}\) we get \(du = \frac{dx}{2}\) so \(dx = 2du\text{.}\) Also, this substitution turns the lower bound \(x = 3\) to \(u = \frac{3-1}{2} = 1\) and the upper bound \(x = 7\) to \(u = \frac{7-1}{2} = 3\text{.}\) This gives us \(\int_3^7\sqrt{\frac{x-1}{2}}\, dx = \int_1^3 \sqrt{u}\cdot 2 du = \frac{4}{3}3^{\frac32}-\frac{4}{3}1^{\frac32} = 4\sqrt{3}-\frac43\)

Subsection A.1.7 Integration by parts

Integration by parts is the reverse of the product rule; it is done via the formula
\begin{equation*} \int uv' = uv - \int vu' \end{equation*}
Here is a list of the order of preferences for the choice of \(u\) (e.g., if there is a logarithm in the integral, it is best to let \(u\) be the logarithmic function). The inverse trigonometric one is unlikely to show up in this course.
  • Logarithmic functions
  • Inverse trigonometric functions
  • polynomials and roots
  • trigonometric functions
  • exponential functions
Below are some examples of integrals solved using integration by parts.

Example A.1.17.

Compute \(\int (x + 1)e^x \, dx\)
We do \(u = x + 1, v' = e^x\text{,}\) which gives \(u' = 1, v = e^x\text{;}\) the formula therefore says
\begin{equation*} \int (x + 1)e^x \, dx = (x+1)e^x - \int e^x \, dx = (x+1)e^x - e^x + C = xe^x + C \end{equation*}

Example A.1.18.

Compute \(\int e^{2x}\sin(x) \, dx\)
We do \(u = \sin(x), v' = e^{2x}\text{,}\) which gives \(u' = \cos(x), v = \frac{e^{2x}}{2}\text{,}\) so
\begin{equation*} \int e^{2x}\sin(x)\,dx = \frac{\sin(x)e^{2x}}{2}-\int \frac{e^{2x}\cos(x)}{2}\,dx \end{equation*}
\begin{equation*} = \frac{\sin(x)e^{2x}}{2}-\frac12 \int e^{2x}\cos(x)\,dx \end{equation*}
We now have to calculate \(\int e^{2x}\cos(x)\,dx\text{.}\) Using integration by parts again, we have \(u = \cos(x), v' = e^{2x}\text{,}\) so \(u' = -\sin(x), v = \frac{e^{2x}}{2}\text{,}\) and we get
\begin{equation*} \int e^{2x}\cos(x)\,dx = \frac{\cos(x)e^{2x}}{2}-\int \frac{-\sin(x)e^{2x}}{2}\,dx \end{equation*}
\begin{equation*} = \frac{\cos(x)e^{2x}}{2} + \frac12 \int \sin(x)e^{2x}\,dx \end{equation*}
It looks like we are back at square one, but this is actually helpful. We can write
\begin{equation*} \int e^{2x}\sin(x) \, dx = \frac{\sin(x)e^{2x}}{2}-\frac12(\frac{\cos(x)e^{2x}}{2} + \frac12 \int \sin(x)e^{2x}\,dx) \end{equation*}
\begin{equation*} = \frac{\sin(x)e^{2x}}{2} - \frac{\cos(x)e^{2x}}{4} - \frac14 \int \sin(x)e^{2x}\,dx \end{equation*}
If we denote \(I = \int e^{2x}\sin(x) \, dx\text{,}\) this equation can be written as
\begin{equation*} I = \frac{\sin(x)e^{2x}}{2} - \frac{\cos(x)e^{2x}}{4} - \frac14I \end{equation*}
solving this equation for \(I\) yields
\begin{equation*} I = \frac{2\sin(x)e^{2x}}{5} - \frac{\cos(x)e^{2x}}{5} + C \end{equation*}

Example A.1.19.

Compute \(\int_1^2 x^2\ln(x)\,dx\)
We do \(u = \ln(x), v' = x^2\text{,}\) which gives us \(u' = \frac1x, v = \frac{x^3}{3}\text{,}\) so this ends up being
\begin{equation*} \frac{\ln(x)x^3}{3}\Big|_1^2 - \int_1^2 \frac{x^3}{3}\cdot\frac1x \, dx \end{equation*}
\begin{equation*} = \frac83\ln(2) - \frac{x^3}{9}\Big|_1^2 = \frac83\ln(2) - \frac79 \end{equation*}

Subsection A.1.8 Integration by partial fractions

For rational functions (i.e. a quotient of two polynomials), the easiest way to integrate is to rewrite the function as a sum of functions whose integrals are easier to compute. They are typically split into terms of the form \(\frac{a}{x+b}\) or \(\frac{a}{(x+b)^n}\text{.}\) Below is a basic example.

Example A.1.20.

Compute \(\int \frac{8x-20}{x^2-2x-3}\,dx\)
The denominator factors as \((x - 3)(x + 1)\text{,}\) so we want to write this as \(\frac{8x-20}{x^2-2x-3} = \frac{A}{x-3} + \frac{B}{x+1}\text{;}\) multiplying both sides by \((x-3)(x+1)\) gives
\begin{equation*} 8x-20 = A(x+1) + B(x-3) \end{equation*}
There are two ways to solve this; we can expand out the right-hand-side and equate like terms, or pick "smart" choices for \(x\) that help us solve. Both methods are useful in different situations, so I will show both.
If we multiply out the right side, we get \(Ax + A + Bx - 3B = (A + B)x + (A - 3B)\) which has to equal \(8x-20\text{;}\) equating coefficients gives \(A + B = 8, A - 3B = -20\text{,}\) and solving yields \(A = 1, B = 7\text{.}\)
Instead of multiplying out, we could have noted that plugging in \(x=-1\) into the equation eliminates the \(A\) variable, and we get \(-28=-4B\text{,}\) so \(B=7\text{,}\) and plugging in \(x = 3\) gives \(4=4A\text{,}\) so \(A=1\text{.}\) We then have
\begin{equation*} \int \frac{8x-20}{x^2-2x-3}\,dx = \int \frac{1}{x-3} + \frac{7}{x+1}\,dx = \ln|x-3| + 7\ln|x+1| + C \end{equation*}
Below is an example where we have to use a term of the form \(\frac{a}{(x+b)^n}\text{,}\) where \(n > 1\text{.}\)

Example A.1.21.

Compute \(\int \frac{3x^2+3x+1}{x^3+2x^2+x}\,dx\)
Factoring the denominator gives \(x^3+2x^2+x = x(x^2+2x+1) = x(x+1)^2\text{.}\) The partial fractions split-up will therefore be of the form \(\frac{A}{x} + \frac{B}{x+1} + \frac{C}{(x+1)^2}\text{.}\) Then we take the equation \(\frac{A}{x} + \frac{B}{x+1} + \frac{C}{(x+1)^2} = \frac{3x^2+3x+1}{x^3+2x^2+x}\) and multiply both sides by \(x(x+1)^2\text{,}\) which yields
\begin{equation*} A(x+1)^2 + Bx(x+1) + Cx = 3x^2 + 3x + 1 \end{equation*}
Plugging in \(x = 0\) gives \(A = 1\text{.}\) Plugging in \(x = -1\) gives \(-C = 1\text{,}\) so \(C = -1\text{.}\) Then plugging in \(x = 1\) gives \(4A + 2B + C = 7\text{,}\) So \(3+2B=7\text{,}\) so \(B = 2\text{.}\) Therefore,
\begin{equation*} \int \frac{3x^2+3x+1}{x^3+2x^2+x}\,dx = \int \frac{1}{x} + \frac{2}{x+1} - \frac{1}{(x+1)^2}\, dx \end{equation*}
\begin{equation*} = \ln|x| + 2\ln|x+1| + \frac{1}{x+1} + C \end{equation*}
Below is an example where there we cannot factor the denominator into linear terms.

Example A.1.22.

Compute \(\int \frac{4x^2-5x+15}{x^3-2x^2+5x}\,dx\)
The best we can factor the denominator is \(x^3 - 2x^2 + 5x\)\(= x(x^2-2x+5)\text{.}\) As \(x^2-2x+5\) does not factor, our backup plan is to complete the square with it, giving \((x-1)^2+4\text{.}\) The partial fraction split-up is therefore
\begin{equation*} \frac{4x^2-5x+15}{x^3-2x^2+5x} = \frac{A}{x} + \frac{B(x-1)+C}{(x-1)^2+4} \end{equation*}
Multiplying both sides by \(x((x-1)^2+4)\) gives
\begin{equation*} 4x^2-5x+15 = A((x-1)^2+4) + Bx(x-1) + Cx \end{equation*}
Plugging in \(x=0\) gives \(15 = 5A\text{,}\) so \(A=3\text{.}\) Plugging in \(x=1\) gives \(4A + C = 14\text{;}\) since \(A=3\) this yields \(C=2\text{.}\) Finally, plugging in \(x=2\) gives \(21 = 5A + 2B + 2C\text{,}\) so \(B = 1\text{.}\) Therefore,
\begin{equation*} \int \frac{4x^2-5x+15}{x^3-2x^2+5x}\,dx = \int \frac{3}{x} + \int\frac{(x-1)+2}{(x-1)^2+4}\,dx \end{equation*}
\begin{equation*} = 3\ln|x| + \int\frac{(x-1)+2}{(x-1)^2+4} \end{equation*}
To evaluate that last integral, we split it into
\begin{equation*} \frac{x-1}{(x-1)^2+4} + \frac{2}{(x-1)^2+4}. \end{equation*}
The first term can be integrated by substituting \(u = (x-1)^2+4\text{,}\) and we get \(\frac{1}{2}\ln((x-1)^2+4)\text{.}\) For the second term, recall that \(\int \frac{1}{t^2+1}\,dt = \arctan(t)+C\text{.}\) Since \(4 = 2^2\) we can substitute \(x-1 = 2u\) and find the second term integrates to \(\arctan(\frac{x-1}{2})\text{,}\) so the final answer is
\begin{equation*} 3\ln|x| + \frac{1}{2}\ln((x-1)^2+4) + \arctan(\frac{x-1}{2}) + C \end{equation*}