\(\int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx\) [3517]

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

Optimal result

Integrand size = 31, antiderivative size = 19 \[ \int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx=10-\frac {x}{1+e^x}+5 (-9+3 x) \]

[Out]

-35-x/(exp(x)+1)+15*x

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(60\) vs. \(2(19)=38\).

Time = 0.18 (sec) , antiderivative size = 60, normalized size of antiderivative = 3.16, number of steps used = 17, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.387, Rules used = {6820, 6874, 2215, 2221, 2317, 2438, 2216, 2222, 2320, 36, 29, 31} \[ \int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx=-\frac {x^2}{2}+\frac {1}{2} (1-x)^2-\frac {x}{e^x+1}+16 x+(1-x) \log \left (e^x+1\right )+x \log \left (e^x+1\right )-\log \left (e^x+1\right ) \]

[In]

Int[(14 + 15*E^(2*x) + E^x*(29 + x))/(1 + 2*E^x + E^(2*x)),x]

[Out]

(1 - x)^2/2 + 16*x - x/(1 + E^x) - x^2/2 - Log[1 + E^x] + (1 - x)*Log[1 + E^x] + x*Log[1 + E^x]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2215

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

Rule 2216

Int[((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.))^(p_)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Dis
t[1/a, Int[(c + d*x)^m*(a + b*(F^(g*(e + f*x)))^n)^(p + 1), x], x] - Dist[b/a, Int[(c + d*x)^m*(F^(g*(e + f*x)
))^n*(a + b*(F^(g*(e + f*x)))^n)^p, x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && ILtQ[p, 0] && IGtQ[m, 0
]

Rule 2221

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

Rule 2222

Int[((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((a_.) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.))^(p_.)*
((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*((a + b*(F^(g*(e + f*x)))^n)^(p + 1)/(b*f*g*n*(p + 1
)*Log[F])), x] - Dist[d*(m/(b*f*g*n*(p + 1)*Log[F])), Int[(c + d*x)^(m - 1)*(a + b*(F^(g*(e + f*x)))^n)^(p + 1
), x], x] /; FreeQ[{F, a, b, c, d, e, f, g, m, n, p}, x] && NeQ[p, -1]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 6820

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \frac {14+15 e^{2 x}+e^x (29+x)}{\left (1+e^x\right )^2} \, dx \\ & = \int \left (15+\frac {-1+x}{1+e^x}-\frac {x}{\left (1+e^x\right )^2}\right ) \, dx \\ & = 15 x+\int \frac {-1+x}{1+e^x} \, dx-\int \frac {x}{\left (1+e^x\right )^2} \, dx \\ & = \frac {1}{2} (1-x)^2+15 x-\int \frac {e^x (-1+x)}{1+e^x} \, dx+\int \frac {e^x x}{\left (1+e^x\right )^2} \, dx-\int \frac {x}{1+e^x} \, dx \\ & = \frac {1}{2} (1-x)^2+15 x-\frac {x}{1+e^x}-\frac {x^2}{2}+(1-x) \log \left (1+e^x\right )+\int \frac {1}{1+e^x} \, dx+\int \frac {e^x x}{1+e^x} \, dx+\int \log \left (1+e^x\right ) \, dx \\ & = \frac {1}{2} (1-x)^2+15 x-\frac {x}{1+e^x}-\frac {x^2}{2}+(1-x) \log \left (1+e^x\right )+x \log \left (1+e^x\right )-\int \log \left (1+e^x\right ) \, dx+\text {Subst}\left (\int \frac {1}{x (1+x)} \, dx,x,e^x\right )+\text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^x\right ) \\ & = \frac {1}{2} (1-x)^2+15 x-\frac {x}{1+e^x}-\frac {x^2}{2}+(1-x) \log \left (1+e^x\right )+x \log \left (1+e^x\right )-\text {Li}_2\left (-e^x\right )+\text {Subst}\left (\int \frac {1}{x} \, dx,x,e^x\right )-\text {Subst}\left (\int \frac {1}{1+x} \, dx,x,e^x\right )-\text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^x\right ) \\ & = \frac {1}{2} (1-x)^2+16 x-\frac {x}{1+e^x}-\frac {x^2}{2}-\log \left (1+e^x\right )+(1-x) \log \left (1+e^x\right )+x \log \left (1+e^x\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.23 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.74 \[ \int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx=15 x-\frac {x}{1+e^x} \]

[In]

Integrate[(14 + 15*E^(2*x) + E^x*(29 + x))/(1 + 2*E^x + E^(2*x)),x]

[Out]

15*x - x/(1 + E^x)

Maple [A] (verified)

Time = 0.32 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.74

method result size
risch \(15 x -\frac {x}{{\mathrm e}^{x}+1}\) \(14\)
default \(\frac {x \,{\mathrm e}^{x}}{{\mathrm e}^{x}+1}+14 \ln \left ({\mathrm e}^{x}\right )\) \(17\)
norman \(\frac {14 x +15 \,{\mathrm e}^{x} x}{{\mathrm e}^{x}+1}\) \(17\)
parallelrisch \(\frac {14 x +15 \,{\mathrm e}^{x} x}{{\mathrm e}^{x}+1}\) \(17\)

[In]

int((15*exp(x)^2+(x+29)*exp(x)+14)/(exp(x)^2+2*exp(x)+1),x,method=_RETURNVERBOSE)

[Out]

15*x-x/(exp(x)+1)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.84 \[ \int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx=\frac {15 \, x e^{x} + 14 \, x}{e^{x} + 1} \]

[In]

integrate((15*exp(x)^2+(x+29)*exp(x)+14)/(exp(x)^2+2*exp(x)+1),x, algorithm="fricas")

[Out]

(15*x*e^x + 14*x)/(e^x + 1)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.42 \[ \int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx=15 x - \frac {x}{e^{x} + 1} \]

[In]

integrate((15*exp(x)**2+(x+29)*exp(x)+14)/(exp(x)**2+2*exp(x)+1),x)

[Out]

15*x - x/(exp(x) + 1)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.74 \[ \int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx=14 \, x + \frac {x e^{x}}{e^{x} + 1} \]

[In]

integrate((15*exp(x)^2+(x+29)*exp(x)+14)/(exp(x)^2+2*exp(x)+1),x, algorithm="maxima")

[Out]

14*x + x*e^x/(e^x + 1)

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.84 \[ \int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx=\frac {15 \, x e^{x} + 14 \, x}{e^{x} + 1} \]

[In]

integrate((15*exp(x)^2+(x+29)*exp(x)+14)/(exp(x)^2+2*exp(x)+1),x, algorithm="giac")

[Out]

(15*x*e^x + 14*x)/(e^x + 1)

Mupad [B] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.68 \[ \int \frac {14+15 e^{2 x}+e^x (29+x)}{1+2 e^x+e^{2 x}} \, dx=15\,x-\frac {x}{{\mathrm {e}}^x+1} \]

[In]

int((15*exp(2*x) + exp(x)*(x + 29) + 14)/(exp(2*x) + 2*exp(x) + 1),x)

[Out]

15*x - x/(exp(x) + 1)