$SPAD/src/input intbypart.input

Timothy Daly December 3, 2016

Abstract

This are functions which are usually solved using integration by parts.

Contents

2

— * —

)set break resume
)spool intbypart.output
)set message test on
)set message auto off
)clear all

———-

1 Overview

If u and v are functions, the product rule yields

D_{x}(uv) = uv′ + vu′

which can be rewritten in terms of the antiderivatives as follows:

uv = ∫ uv′dx + ∫ vu′dx

We can rewrite the terms of the sum:

∫ uv′dx ==> ∫ udv

∫ vu′dx ==> ∫ vdu

so the sum now becomes:

uv = ∫ udv + ∫ vdu

We can now rearrange the terms into

∫ udv = uv − ∫ vdu

The purpose of this rewrite is to solve the “hard” integral

∫ udv

by an “easy” integral

∫ vdu

2 integrate x ln(x)dx

To integrate

∫ x ln(x)dx

choose

u = ln(x)
dv = x dx

thus we find that

du = \frac{1}{x}dx

v = \frac{1}{2}x^{2}

so

∫ x ln(x)dx

= ∫ udv = uv − ∫ vdu

= (ln(x))(\frac{1}{2}x^{2}) − ∫ (\frac{1}{2}x^{2})(\frac{1}{x}dx)

= \frac{1}{2}x^{2}ln(x) − \frac{1}{2} ∫ xdx

= \frac{1}{2}ln(x) − \frac{1}{4}x^{2} + C

= \frac{1}{4}x^{2}(2ln(x) − 1) + C

— * —

--S 1 of 16
integrate(x*log(x),x)
--R
--R          2          2
--R        2x log(x) - x
--R   (1)  --------------
--R               4
--R                                         Type: Union(Expression(Integer),...)
--E 1

———-

3 integrate xe^{x}

To solve

∫ xe^{x} dx

let

u = x
dv = e^{x}dx

and find that

du = dx
v = e^{x}

so that

∫ xe^{x}dx

uv − ∫ vdu

= xe^{x} − ∫ e^{x}dx
= xe^{x} − e^{x} + C
= (x − 1)e^{x} + C

— * —

--S 2 of 16
integrate(x*exp(x),x)
--R
--R                 x
--R   (2)  (x - 1)%e
--R                                         Type: Union(Expression(Integer),...)
--E 2

———-

4 integrate e^{x}cos(x)dx

This integral will require the substituion by parts rule to be applied twice. Given

∫ e^{x}cos(x)dx

we let u = e^{x}

dv = cos(x)dx

du = e^{x}dx
v = sin(x)

thus

∫ e^{x}cos(x)dx = e^{x}sin(x) − ∫ e^{x}sin(x)dx  (1)

and then we substitute again to solve the integral

∫ e^{x}sin(x)dx

so that

u = e^{x}
dv = sin(x)dx
du = e^{x}dx
v = −cos(x)

therefore

∫ e^{x}sin(x)dx
= −e^{x}cos(x) − ∫ −e^{x}cos(x)dx
= −e^{x}cos(x) + ∫ e^{x}cos(x)dx

and then we substitute equation (1)

∫ e^{x}cos(x)dx
= e^{x}sin(x) − (−e^{x}cos(x) + ∫ e^{x}cos(x)dx)
= e^{x}sin(x) + e^{x}cos(x) − ∫ e^{x}cos(x)dx

by adding

∫ e^{x}cos(x)dx

to both sides we get

2 ∫ e^{x}cos(x)dx

= e^{x}sin(x) + e^{x}cos(x)

= \frac{1}{2}(e^{x}sin(x) + e^{x}cos(x))

so

∫ e^{x}cos(x)dx = \frac{1}{2}(e^{x}sin(x) + e^{x}cos(x)) + C

— * —

--S 3 of 16
integrate(exp(x)*sin(x),x)
--R
--R          x                 x
--R        %e sin(x) - cos(x)%e
--R   (3)  ---------------------
--R                  2
--R                                         Type: Union(Expression(Integer),...)
--E 3

———-

5 integrate x^{3}e^{x^{2}}dx

u = x^{2}

dv = xe^{x^{2}}

du = 2xdx

v = \frac{1}{2}e^{x^{2}}

so

∫ x^{3}e^{x^{2}}

= \frac{1}{2}x^{2}e^{x^{2}} − ∫ xe^{x^{2}}dx

= \frac{1}{2}x^{2}e^{x^{2}} − \frac{1}{2}e^{x^{2}} + C

= \frac{1}{2}(x^{2} − 1)e^{x^{2}} + C

— * —

--S 4 of 16
integrate(x^3*exp(x^2),x)
--R
--R                   2
--R          2       x
--R        (x  - 1)%e
--R   (4)  ------------
--R              2
--R                                         Type: Union(Expression(Integer),...)
--E 4

———-

6 integrate ln(x^{2} + 2)dx

To integrate

∫ ln(x^{2} + 2)dx

let u = ln(x^{2} + 2)

dv = dx

du = \frac{2x}{x^{2} + 2}dx

v = x

so that

∫ ln(x^{2} + 2)dx

= xln(x^{2} + 2) − 2 ∫ \frac{x^{2}}{x^{2} + 2}dx

= xln(x^{2} + 2) − 2 ∫ (1 − \frac{2}{x^{2} + 2}) dx

= xln(x^{2} + 2) − 2x + \frac{4}{\sqrt{2}} tan^{−1} (\frac{x}{\sqrt{2}}) + C

x(ln(x^{2} + 2) − 2) + 2\sqrt{2} tan^{−1} (\frac{x}{\sqrt{2}}) + C

— * —

--S 5 of 16
integrate(log(x^2+2),x)
--R
--R                                   +-+
--R               2          +-+     \|2
--R   (5)  x log(x  + 2) - 2\|2 atan(----) - 2x
--R                                    x
--R                                         Type: Union(Expression(Integer),...)
--E 5

———-

7 integrate x sin(x)dx

To integrate

∫ x sin(x) dx

Let

u = x
dv = sin(x) dx
du = dx
v = −cos(x)

so

∫ x sin(x) dx

= −x cos(x) − ∫ −cos(x) dx
= −x cos(x) + sin(x) + C

— * —

--S 6 of 16
integrate(x*sin(x),x)
--R
--R   (6)  sin(x) - x cos(x)
--R                                         Type: Union(Expression(Integer),...)
--E 6

———-

8 integrate x cos(x)dx

To integrate

∫ x cos(x) dx

Let

u = x
dv = cos(x) dx
du = dx
v = sin(x)

so

∫ x cos(x) dx

= x sin(x) − ∫ sin(x) dx
= x sin(x) + cos(x) + C

— * —

--S 7 of 16
integrate(x*cos(x),x)
--R
--R
--R   (7)  x sin(x) + cos(x)
--R                                         Type: Union(Expression(Integer),...)
--E 7

———-

9 integrate x^{2} sin(x)dx

To integrate

∫ x^{2} sin(x) dx

Let

u = x^{2}
dv = sin(x) dx
du = 2x dx
v = −cos(x)

so

∫ x^{2} sin(x) dx
= −x^{2} cos(x) − ∫ −2x cos(x) dx
= −x^{2} cos(x) + 2 ∫ x cos(x) dx
= −x^{2} cos(x) + 2(x sin(x) + cos(x)) + C

— * —

--S 8 of 16
integrate(x^2*cos(x),x)
--R
--R
--R          2
--R   (8)  (x  - 2)sin(x) + 2x cos(x)
--R                                         Type: Union(Expression(Integer),...)
--E 8

———-

10 integrate sin(x) cos(x) dx

To integrate

∫ sin(x) cos(x) dx

Let

u = sin(x)
dv = cos(x) dx
du = cos(x) dx
v = sin(x)

so

∫ sin(x)cos(x)dx = sin(x)sin(x) − ∫ sin(x)cos(x)dx

but the integral appears on both sides of the equation so

2 ∫ sin(x)cos(x)dx = sin^{2}(x)

so

∫ sin(x)cos(x)dx = \frac{1}{2}sin^{2}(x) + C

— * —

--S 9 of 16
integrate(sin(x)*cos(x),x)
--R
--R
--R                2
--R          cos(x)
--R   (9)  - -------
--R             2
--R                                         Type: Union(Expression(Integer),...)
--E 9

———-

11 integrate ln(x)dx

To integrate

∫ ln(x)dx

Let u = ln(x)

dv = dx

du = \frac{1}{x}dx

v = x

so

∫ ln(x) dx
= x ln(x) = ∫ 1 dx
= x ln(x) − x + C
= x(ln(x) − 1) + C

— * —

--S 10 of 16
integrate(log(x),x)
--R
--R   (10)  x log(x) - x
--R                                         Type: Union(Expression(Integer),...)
--E 10

———-

12 integrate x^{2} ln(x) dx

To integrate

∫ x^{2} ln(x) dx

Let u = ln(x)

dv = x^{2} dx

du = \frac{dx}{x}

v = \frac{x^{3}}{3}

so

∫ x^{2} ln(x) dx

\frac{x^{3}}{3} ln(x) − ∫ \frac{x^{3}}{3} \frac{dx}{x}

\frac{x^{3}}{3} ln(x) − \frac{1}{3} ∫ x^{2} dx

\frac{x^{3}}{3} ln(x) − \frac{1}{9}x^{3} + C

— * —

--S 11 of 16
integrate(x^2*log(x),x)
--R
--R           3          3
--R         3x log(x) - x
--R   (11)  --------------
--R                9
--R                                         Type: Union(Expression(Integer),...)
--E 11

———-

13 integrate x^{2} e^{x} dx

To integrate

∫ x^{2} e^{x} dx

Let

u = x^{2}
dv = e^{x} dx
du = 2x dx
v = e^{x}

so

∫ x^{2} e^{x} dx

x^{2} e^{x} − 2x e^{x} − ∫ e^{x} 2dx
x^{2} e^{x} − 2x e^{x} + 2 e^{x} + C

— * —

--S 12 of 16
integrate(x^2*exp(x),x)
--R
--R
--R           2            x
--R   (12)  (x  - 2x + 2)%e
--R                                         Type: Union(Expression(Integer),...)
--E 12

———-

14 integrate sin^{−1}(x) dx

To integrate

∫ sin^{−1}(x) dx

Let u = sin^{−1}(x)

dv = dx

du = \frac{1}{\sqrt{1 − x^{2}}} dx

v = x

so

∫ sin^{−1}(x) dx

= x sin^{−1}(x) − ∫ \frac{x}{\sqrt{1 − x^{2}}} dx

x sin^{−1}(x) + \frac{1}{2} ∫ (1 − x^{2})^{−1/2}(−2x) dx

= x sin^{−1}(x) + \frac{1}{2}(2(1 − x^{2})^{1/2}) + C

= x sin^{−1}(x) + (1 − x^{2})^{1/2} + C

= x sin^{−1}(x) + \sqrt{1 − x^{2}} + C

— * —

--S 13 of 16
integrate(asin(x),x)
--R
--R
--R                     +--------+
--R                     |   2           +--------+
--R                  2x\|- x  + 1       |   2
--R         - x atan(-------------) + 2\|- x  + 1
--R                       2
--R                     2x  - 1
--R   (13)  --------------------------------------
--R                            2
--R                                         Type: Union(Expression(Integer),...)
--E 13

———-

15 integrate tan^{−1}(x) dx

∫ tan^{−1}(x) dx

Let u = tan^{−1}

dv = dx

du = \frac{1}{1 + x^{2}} dx

v = x

so

∫ tan^{−1}(x) dx

= x tan^{−1} − ∫ \frac{x}{1 + x^{2}} dx

= x tan^{−1}(x) − \frac{1}{2} ∫ \frac{2x}{1 + x^{2}} dx

= x tan^{−1}(x) − \frac{1}{2}ln(1 + x^{2}) + C

— * —

--S 14 of 16
integrate(atan(x),x)
--R
--R
--R                2                 2x
--R         - log(x  + 1) - x atan(------)
--R                                 2
--R                                x  - 1
--R   (14)  ------------------------------
--R                        2
--R                                         Type: Union(Expression(Integer),...)
--E 14

———-

16 integrate sec^{3}(x) dx

∫ sec^{3}(x) dx

Let

u = sec(x)
dv = sec^{2}(x) dx

du = sec(x)tan(x) dx
v = tan(x)

so

∫ sec^{3}(x) dx

= sec(x)tan(x) − ∫ sec(x)tan^{2}(x) dx

= sec(x)tan(x) − ∫ sec(x)(sec^{2}(x) − 1) dx

= sec(x)tan(x) − ∫ sec^{3}(x) dx + ∫ sec(x) dx

= sec(x)tan(x) − ∫ sec^{3}(x) dx + ln(|sec(x) + tan(x)|)

but

= 2 ∫ sec^{3}(x) dx = sec(x)tan(x) + ln(|sec(x) + tan(x)|)

so

∫ sec^{3}(x) dx = \frac{1}{2}(sec(x)tan(x) + ln(|sec(x) + tan(x)|)) + C

— * —

--S 15 of 16
integrate(sec(x)^3,x)
--R
--R
--R   (15)
--R         2    sin(x) + cos(x) + 1          2    sin(x) - cos(x) - 1
--R   cos(x) log(-------------------) - cos(x) log(-------------------) + sin(x)
--R                   cos(x) + 1                        cos(x) + 1
--R   --------------------------------------------------------------------------
--R                                           2
--R                                    2cos(x)
--R                                         Type: Union(Expression(Integer),...)
--E 15

———-

17 integrate x^{3} e^{2x}

∫ x^{3} e^{2x} dx

Let u = x^{3} dv = e^{2x} dx du = 3x^{2} dx

v = \frac{1}{2}e^{2x}

∫ x^{3} e^{2x} dx

= \frac{1}{2}x^{3} e^{2x} − \frac{3}{2} ∫ x^{2} e^{2x} dx

To solve

\frac{3}{2} ∫ x^{2} e^{2x} dx

Let

u = x^{2} dv = e^{2x} dx du = 2x dx

v = \frac{1}{2}e^{2x}

so after substitution the new result is

= \frac{1}{2}x^{3} e^{2x} − \frac{3}{2} (\frac{1}{2}x^{2} e^{2x} − ∫ xe^{2x} dx)

= \frac{1}{2}x^{3} e^{2x} − \frac{3}{4}x^{2}e^{2x} + \frac{3}{2} ∫ xe^{2x} dx

Let

u = x dv = e^{2x} dx du = dx

v = \frac{1}{2}e^{2x}

so

∫ x^{3} e^{2x} dx

= \frac{1}{2}x^{3} e^{2x} − \frac{3}{4}x^{2} e^{2x} + \frac{3}{2} (\frac{1}{2}xe^{2x} − \frac{1}{2} ∫ e^{2x} dx)

= \frac{1}{2}x^{3} e^{2x} − \frac{3}{4}x^{2} e^{2x} + \frac{3}{4}xe^{2x} − \frac{3}{8}e^{2x} + C

— * —

--S 16 of 16
integrate(x^3*exp(2*x),x)
--R
--R
--R            3     2            2x
--R         (4x  - 6x  + 6x - 3)%e
--R   (16)  ------------------------
--R                     8
--R                                         Type: Union(Expression(Integer),...)
--E 16
)spool
)lisp (bye)

———-

References

[1] Ayres, Frank Jr. and Mendelson, Elliott “Calculus” Schaum’s Outlines 4th edition 1999 ISBN 0-07-041973-6 pp281-285