I’m having some troubles on the analytical integration over the variable z of this function using Mathematica:
z^6 Erfc[b \[Rho] - d \[Rho] - a n \[Rho] - c z \[Rho] - a m z \[Rho]]
With the following assumptions:
Assumptions -> \[Rho] > 0 && a \[Element] Reals && b \[Element] Reals && c \[Element] Reals && d \[Element] Reals && m \[Element] Reals && n \[Element] Reals]
Thus, I use the following command:
Integrate[
z^6 Erfc[
b \[Rho] - d \[Rho] - a n \[Rho] - c z \[Rho] -
a m z \[Rho]], z,
Assumptions -> \[Rho] > 0 && a \[Element] Reals &&
b \[Element] Reals && c \[Element] Reals && d \[Element] Reals &&
m \[Element] Reals && n \[Element] Reals]
I can’t understand why Mathematica cannot integrate this function, while if I lower the degree of z^6 the integration is performed without any problems. For instance, this function gets integrated fine and smoothly over z and using the same assumptions:
z^5 Erfc[b \[Rho] - d \[Rho] - a n \[Rho] - c z \[Rho] - a m z \[Rho]]
Thank you for the time spent on reading this. Looking forward to your help!
The WL language may miss some integrals. It happens.
For this one, you could try:
sol = SolveValues[
b \[Rho] - d \[Rho] - a n \[Rho] - c z \[Rho] -
a m z \[Rho] == \[Phi], z][[1]]
cov = D[sol, \[Phi]]
integral = cov (-(1/((c + a m) \[Rho]))) Integrate[((
b \[Rho] - d \[Rho] -
a n \[Rho] - \[Phi])/((c + a m) \[Rho]))^6 Erf[\[Phi]], \[Phi]]
gives a closed form.
checking:
dintegral =
D[integral /. \[Phi] ->
b \[Rho] - d \[Rho] - a n \[Rho] - c z \[Rho] - a m z \[Rho], z];
Simplify[dintegral] (*z^6 Erf[(b - d - a n - c z - a m z) \[Rho]]*)
Thanks a lot for your reply! The integral gives indeed a closed form.
I just miss the part where the variable “cov” seems being squared before the integral. Why is that?
cov^2 Integrate[((
b \[Rho] - d \[Rho] -
a n \[Rho] - \[Phi])/((c + a m) \[Rho]))^6 Erf[\[Phi]], \[Phi]]
Since:
cov=-(1/((c + a m) \[Rho]))
Inspired by your answer, I would have set the integral this way:
z=((b \[Rho] - d \[Rho] - a n \[Rho] - \[Phi])/((c + a m) \[Rho]))
cov = dz/d\[Phi] = -(1/((c + a m) \[Rho]))
Integrate[((b \[Rho] - d \[Rho] - a n \[Rho] - \[Phi])/((c + a m) \[Rho]))^6 Erf[\[Phi]] (-(1/((c + a m) \[Rho]))), \[Phi]]
Integrate[z^6 Erfc[A1 + A2 z + A3 z], z] /. A1 -> b ρ - d ρ - a n ρ /. A2 -> -c * ρ /. A3 -> -a*m*ρ // Simplify
(*1/56 ((1/((c + a m)^7 Sqrt[π] ρ^7))
2 E^(-(-b + d + a n + c z + a m z)^2 ρ^2) (24 +
87 (-b + d + a n)^2 ρ^2 + 40 (-b + d + a n)^4 ρ^4 +
4 (-b + d + a n)^6 ρ^6 -
4 (c + a m)^5 (-b + d + a n) z^5 ρ^6 +
4 (c + a m)^6 z^6 ρ^6 +
4 (c + a m)^4 z^4 ρ^4 (3 + (-b + d + a n)^2 ρ^2) +
2 (c + a m)^3 (b - d - a n) z^3 ρ^4 (11 +
2 (-b + d + a n)^2 ρ^2) +
2 (c + a m)^2 z^2 ρ^2 (12 + 15 (-b + d + a n)^2 ρ^2 +
2 (-b + d + a n)^4 ρ^4) + (c + a m) (b - d -
a n) z ρ^2 (57 + 36 (-b + d + a n)^2 ρ^2 +
4 (-b + d + a n)^4 ρ^4)) - (
8 (-b + d + a n)^7 Erf[(b - d - a n - c z - a m z) ρ])/(c +
a m)^7 - (
105 (-b + d + a n) Erf[(b - d - a n - c z - a m z) ρ])/((c +
a m)^7 ρ^6) - (
210 (-b + d + a n)^3 Erf[(b - d - a n - c z - a m z) ρ])/((c +
a m)^7 ρ^4) - (
84 (-b + d + a n)^5 Erf[(b - d - a n - c z - a m z) ρ])/((c +
a m)^7 ρ^2) +
8 z^7 Erfc[(b - d - a n - c z - a m z) ρ])
*)