sympy/sympy — pull request #1927 by lidavidm (2013-03-24 17:10:21+00:00)
Title: Manual integration

Changes:
- Add function that integrates "by hand"
- Add function that gives steps for such an integral (does not include a pretty-printer)

Do we want this as an option to `integrate`/`Integral.doit`?

Not implemented:

- [Trigonometric substitution](http://en.wikipedia.org/wiki/Trigonometric_substitution)
- Clever u-substitutions/parts integrals (e.g. `x^3 exp(x^2)` with `u = x^2`, `dv = x exp(x^2)`; `x sqrt(x-2)` changed to `(u+2)sqrt(u)`)

Examples:

>>> from sympy import sin, cos, tan, sec, exp, log, integrate
>>> from sympy.integrals.manualintegrate import manualintegrate
>>> from sympy.abc import x
>>> manualintegrate(1 / x, x)
log(Abs(x))
>>> integrate(1/x)
log(x)
>>> manualintegrate(log(x), x)
x*log(x) - x
>>> integrate(log(x))
x*log(x) - x
>>> manualintegrate(exp(x) / (1 + exp(2 * x)), x)
atan(exp(x))
>>> integrate(exp(x) / (1 + exp(2 * x)))
RootSum(4*_z**2 + 1, Lambda(_i, _i*log(2*_i + exp(x))))
>>> manualintegrate(cos(x)**4 * sin(x), x)
-cos(x)**5/5
>>> integrate(cos(x)**4 * sin(x), x)
-cos(x)**5/5
>>> manualintegrate(cos(x)**4 * sin(x)**3, x)
cos(x)**7/7 - cos(x)**5/5
>>> integrate(cos(x)**4 * sin(x)**3, x)
cos(x)**7/7 - cos(x)**5/5
>>> manualintegrate(tan(x), x)
-log(Abs(cos(x)))
>>> integrate(tan(x), x)
-log(sin(x)**2 - 1)/2
>>> manualintegrate(sec(x), x)
log(Abs(sec(x) + tan(x)))
>>> integrate(sec(x), x)
-log(sin(x) - 1)/2 + log(sin(x) + 1)/2
>>> manualintegrate(sec(x)**4 *tan(x)**4, x)
tan(x)**7/7 + tan(x)**5/5
>>> integrate(sec(x)**4 *tan(x)**4, x)
2*sin(x)/(35*cos(x)) + sin(x)/(35*cos(x)**3) - 8*sin(x)/(35*cos(x)**5) + sin(x)/(7*cos(x)**7)