Adding Assumptions
its better option to Integrate
.
INT = Integrate[1/γ^2*Exp[-t/γ - Abs[t - τ]/μ]*(t - t^2/(2*γ)), {t, 0, Infinity},
Assumptions -> {μ > 0, γ > 0, τ > 0}] // FullSimplify
$\frac{\mu e^{\tau \left(-\left(\frac{1}{\gamma }+\frac{1}{\mu }\right)\right)} \left(\gamma ^2 \mu (\gamma +\mu )^3
e^{\frac{\tau }{\gamma }}-e^{\frac{\tau }{\mu }} \left(2 \gamma \tau \left(\mu ^4-\gamma ^4\right)+\tau ^2 \left(\gamma
^2-\mu ^2\right)^2+2 \gamma ^2 \mu ^2 \left(3 \gamma ^2+\mu ^2\right)\right)\right)}{\gamma \left(\gamma ^2-\mu ^2\right)^3}$
Without Assumptions
option MMA fail to give the answer.We can use RealAbs
than Abs
Integrate[1/γ^2*Exp[-t/γ - RealAbs[t - τ]/μ]*(t - t^2/(2*γ)), {t,0, Infinity}]// FullSimplify
$\begin{cases}
\text{Integrate}\left[\frac{\left(t-\frac{t^2}{2 \gamma }\right) e^{-\frac{\left| t-\tau \right| }{\mu }-\frac{t}{\gamma
}}}{\gamma ^2},\{t,0,\infty \},\text{Assumptions}\to \Re\left(\frac{1}{\gamma }+\frac{1}{\mu }\right)\leq 0\right] & \left(\tau
>0\land \Re\left(\frac{1}{\gamma }+\frac{1}{\mu }\right)\leq 0\right)\lor \left(\tau \leq 0\land \Re\left(\frac{1}{\gamma
}+\frac{1}{\mu }\right)\leq 0\right) \\
\frac{\gamma \mu ^2 \sinh \left(\frac{\tau }{\mu }\right)+\gamma \mu ^2 \cosh \left(\frac{\tau }{\mu }\right)}{(\gamma +\mu
)^3} & \tau \leq 0\land \Re\left(\frac{1}{\gamma }+\frac{1}{\mu }\right)>0 \\
\frac{\mu \left(\gamma ^5 \mu \sinh \left(\frac{\tau }{\gamma }\right)+2 \gamma ^5 \tau \sinh \left(\frac{\tau }{\mu
}\right)+\gamma ^5 \mu \cosh \left(\frac{\tau }{\gamma }\right)+2 \gamma ^5 \tau \cosh \left(\frac{\tau }{\mu }\right)+3
\gamma ^4 \mu ^2 \sinh \left(\frac{\tau }{\gamma }\right)-6 \gamma ^4 \mu ^2 \sinh \left(\frac{\tau }{\mu }\right)+3 \gamma ^4
\mu ^2 \cosh \left(\frac{\tau }{\gamma }\right)-6 \gamma ^4 \mu ^2 \cosh \left(\frac{\tau }{\mu }\right)-\gamma ^4 \tau ^2
\sinh \left(\frac{\tau }{\mu }\right)-\gamma ^4 \tau ^2 \cosh \left(\frac{\tau }{\mu }\right)+3 \gamma ^3 \mu ^3 \sinh
\left(\frac{\tau }{\gamma }\right)+3 \gamma ^3 \mu ^3 \cosh \left(\frac{\tau }{\gamma }\right)+\gamma ^2 \mu ^4 \sinh
\left(\frac{\tau }{\gamma }\right)-2 \gamma ^2 \mu ^4 \sinh \left(\frac{\tau }{\mu }\right)+\gamma ^2 \mu ^4 \cosh
\left(\frac{\tau }{\gamma }\right)-2 \gamma ^2 \mu ^4 \cosh \left(\frac{\tau }{\mu }\right)+2 \gamma ^2 \mu ^2 \tau ^2 \sinh
\left(\frac{\tau }{\mu }\right)+2 \gamma ^2 \mu ^2 \tau ^2 \cosh \left(\frac{\tau }{\mu }\right)-2 \gamma \mu ^4 \tau \sinh
\left(\frac{\tau }{\mu }\right)-2 \gamma \mu ^4 \tau \cosh \left(\frac{\tau }{\mu }\right)-\mu ^4 \tau ^2 \sinh
\left(\frac{\tau }{\mu }\right)-\mu ^4 \tau ^2 \cosh \left(\frac{\tau }{\mu }\right)\right) \left(\cosh \left(\frac{\tau
}{\gamma }+\frac{\tau }{\mu }\right)-\sinh \left(\frac{\tau }{\gamma }+\frac{\tau }{\mu }\right)\right)}{\gamma (\gamma -\mu
)^3 (\gamma +\mu )^3} & \text{True}
\end{cases}$
Check:
INT /. γ -> 2 /. μ -> 1 /. τ -> 1 // N(* Assumed parameters *)
(* 0.14046 *)
INTN[γ_, μ_, τ_] := NIntegrate[1/γ^2*Exp[-t/γ - Abs[t - τ]/μ]*(t - t^2/(
2*γ)), {t, 0, Infinity}]
INTN[2, 1, 1]
(* 0.14046 *)
About blows up when $γ=μ$ use Limit
:
Limit[INT /. γ -> 2 /. τ -> 1, μ -> 2] // N
(* 0.176905 *)
INTN[γ_, μ_, τ_] := NIntegrate[1/γ^2*
Exp[-t/γ - Abs[t - τ]/μ]*(t - t^2/(2*γ)), {t, 0, Infinity}]
INTN[2, 2, 1]
(* 0.176905 *)
t
use{t,0,Infinity}
insideIntegrate
. $\endgroup$Integrate[ 1/γ^2* Exp[-t/γ - RealAbs[t - τ]/μ]*(t - t^2/(2*γ)), t]
and ? $\endgroup$