\(\int \frac {1}{20} (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x) \, dx\) [9716]

   Optimal result
   Rubi [B] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 43, antiderivative size = 21 \[ \int \frac {1}{20} \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx=-1+\frac {x}{20}+\left (e^{-x}-e^x+x\right )^2 \]

[Out]

1/20*x-1+(x-exp(x)+exp(-x))^2

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(51\) vs. \(2(21)=42\).

Time = 0.02 (sec) , antiderivative size = 51, normalized size of antiderivative = 2.43, number of steps used = 8, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.070, Rules used = {12, 2225, 2207} \[ \int \frac {1}{20} \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx=x^2+\frac {x}{20}+e^{-2 x}+2 e^{-x}+2 e^x+e^{2 x}-2 e^{-x} (1-x)-2 e^x (x+1) \]

[In]

Int[(1 - 40/E^(2*x) + 40*E^(2*x) + E^x*(-40 - 40*x) + (40 - 40*x)/E^x + 40*x)/20,x]

[Out]

E^(-2*x) + 2/E^x + 2*E^x + E^(2*x) - (2*(1 - x))/E^x + x/20 + x^2 - 2*E^x*(1 + x)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{20} \int \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx \\ & = \frac {x}{20}+x^2+\frac {1}{20} \int e^x (-40-40 x) \, dx+\frac {1}{20} \int e^{-x} (40-40 x) \, dx-2 \int e^{-2 x} \, dx+2 \int e^{2 x} \, dx \\ & = e^{-2 x}+e^{2 x}-2 e^{-x} (1-x)+\frac {x}{20}+x^2-2 e^x (1+x)-2 \int e^{-x} \, dx+2 \int e^x \, dx \\ & = e^{-2 x}+2 e^{-x}+2 e^x+e^{2 x}-2 e^{-x} (1-x)+\frac {x}{20}+x^2-2 e^x (1+x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.57 \[ \int \frac {1}{20} \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx=e^{-2 x}+e^{2 x}+\frac {x}{20}+2 e^{-x} x-2 e^x x+x^2 \]

[In]

Integrate[(1 - 40/E^(2*x) + 40*E^(2*x) + E^x*(-40 - 40*x) + (40 - 40*x)/E^x + 40*x)/20,x]

[Out]

E^(-2*x) + E^(2*x) + x/20 + (2*x)/E^x - 2*E^x*x + x^2

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.33

method result size
risch \(\frac {x}{20}-2 \,{\mathrm e}^{x} x +2 x \,{\mathrm e}^{-x}+x^{2}+{\mathrm e}^{2 x}+{\mathrm e}^{-2 x}\) \(28\)
default \(\frac {x}{20}-2 \,{\mathrm e}^{x} x +2 x \,{\mathrm e}^{-x}+x^{2}+{\mathrm e}^{2 x}+{\mathrm e}^{-2 x}\) \(30\)
parallelrisch \(\frac {x}{20}-2 \,{\mathrm e}^{x} x +2 x \,{\mathrm e}^{-x}+x^{2}+{\mathrm e}^{2 x}+{\mathrm e}^{-2 x}\) \(30\)
parts \(\frac {x}{20}-2 \,{\mathrm e}^{x} x +2 x \,{\mathrm e}^{-x}+x^{2}+{\mathrm e}^{2 x}+{\mathrm e}^{-2 x}\) \(30\)
norman \(\left (1+{\mathrm e}^{4 x}+{\mathrm e}^{2 x} x^{2}+\frac {x \,{\mathrm e}^{2 x}}{20}-2 x \,{\mathrm e}^{3 x}+2 \,{\mathrm e}^{x} x \right ) {\mathrm e}^{-2 x}\) \(39\)

[In]

int(2*exp(x)^2+1/20*(-40*x-40)*exp(x)-2*exp(-x)^2+1/20*(-40*x+40)*exp(-x)+2*x+1/20,x,method=_RETURNVERBOSE)

[Out]

1/20*x-2*exp(x)*x+2*x*exp(-x)+x^2+exp(2*x)+exp(-2*x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (17) = 34\).

Time = 0.24 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.86 \[ \int \frac {1}{20} \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx=-\frac {1}{20} \, {\left (40 \, x e^{\left (3 \, x\right )} - {\left (20 \, x^{2} + x\right )} e^{\left (2 \, x\right )} - 40 \, x e^{x} - 20 \, e^{\left (4 \, x\right )} - 20\right )} e^{\left (-2 \, x\right )} \]

[In]

integrate(2*exp(x)^2+1/20*(-40*x-40)*exp(x)-2*exp(-x)^2+1/20*(-40*x+40)*exp(-x)+2*x+1/20,x, algorithm="fricas"
)

[Out]

-1/20*(40*x*e^(3*x) - (20*x^2 + x)*e^(2*x) - 40*x*e^x - 20*e^(4*x) - 20)*e^(-2*x)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (15) = 30\).

Time = 0.08 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.48 \[ \int \frac {1}{20} \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx=x^{2} - 2 x e^{x} + \frac {x}{20} + 2 x e^{- x} + e^{2 x} + e^{- 2 x} \]

[In]

integrate(2*exp(x)**2+1/20*(-40*x-40)*exp(x)-2*exp(-x)**2+1/20*(-40*x+40)*exp(-x)+2*x+1/20,x)

[Out]

x**2 - 2*x*exp(x) + x/20 + 2*x*exp(-x) + exp(2*x) + exp(-2*x)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.29 \[ \int \frac {1}{20} \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx=x^{2} + 2 \, x e^{\left (-x\right )} - 2 \, x e^{x} + \frac {1}{20} \, x + e^{\left (2 \, x\right )} + e^{\left (-2 \, x\right )} \]

[In]

integrate(2*exp(x)^2+1/20*(-40*x-40)*exp(x)-2*exp(-x)^2+1/20*(-40*x+40)*exp(-x)+2*x+1/20,x, algorithm="maxima"
)

[Out]

x^2 + 2*x*e^(-x) - 2*x*e^x + 1/20*x + e^(2*x) + e^(-2*x)

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.29 \[ \int \frac {1}{20} \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx=x^{2} + 2 \, x e^{\left (-x\right )} - 2 \, x e^{x} + \frac {1}{20} \, x + e^{\left (2 \, x\right )} + e^{\left (-2 \, x\right )} \]

[In]

integrate(2*exp(x)^2+1/20*(-40*x-40)*exp(x)-2*exp(-x)^2+1/20*(-40*x+40)*exp(-x)+2*x+1/20,x, algorithm="giac")

[Out]

x^2 + 2*x*e^(-x) - 2*x*e^x + 1/20*x + e^(2*x) + e^(-2*x)

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.29 \[ \int \frac {1}{20} \left (1-40 e^{-2 x}+40 e^{2 x}+e^x (-40-40 x)+e^{-x} (40-40 x)+40 x\right ) \, dx=\frac {x}{20}+{\mathrm {e}}^{-2\,x}+{\mathrm {e}}^{2\,x}+2\,x\,{\mathrm {e}}^{-x}-2\,x\,{\mathrm {e}}^x+x^2 \]

[In]

int(2*x - 2*exp(-2*x) + 2*exp(2*x) - (exp(x)*(40*x + 40))/20 - (exp(-x)*(40*x - 40))/20 + 1/20,x)

[Out]

x/20 + exp(-2*x) + exp(2*x) + 2*x*exp(-x) - 2*x*exp(x) + x^2