I use Rule-based Integration aka: Rubi from here:
<<Rubi` (*Load package*)
s1 = Int[1/(c^2 + 2*s*e + a*s^2 - 2*t*f - 2*s*t*d + b*t^2)^2, t]
s2 = Limit[s1, t -> 1] - Limit[s1, t -> 0] // Simplify
(*I assumed the original function is continuous*)
s3= Int[s2, s]
s4 = Limit[s3, s -> 1, Assumptions -> {e > 0, c > 0, a > 0, f > 0, d > 0, b > 0}] - Limit[s3, s -> 0,
Assumptions -> {e > 0, c > 0, a > 0, f > 0, d > 0, b > 0}]
(*I assumed the original function is continuous. *)
(*Warning!!! See restrictions about parameters ? *)
s5 = s4[[1]] // Simplify
(* Solution *)
Formula for:
$e > 0, c > 0, a > 0, f > 0, d > 0, b > 0$
and
$-1<\frac{(b e-d f) \Im\left(\frac{1}{\sqrt{a b c^2-c^2 d^2-b e^2+2 d e f-a f^2}}\right)}{\sqrt{b}}<1\land b c^2>f^2\land (d+f)^2<b \left(a+c^2+2 e\right)$
SOL[a_, c_, e_, f_, d_, b_] := (1/(2 (a b c^2 - c^2 d^2 - b e^2 + 2 d e f -
a f^2)))(((d e - a f) ArcTan[e/Sqrt[a c^2 - e^2]])/Sqrt[
a c^2 - e^2] + ((-d e + a f) ArcTan[(a + e)/Sqrt[a c^2 - e^2]])/
Sqrt[a c^2 -
e^2] + ((d (-d + e) + a (b - f)) ArcTan[(d - e)/
Sqrt[-(d - e)^2 + a (b + c^2 - 2 f)]])/
Sqrt[-(d - e)^2 +
a (b + c^2 - 2 f)] + ((d (d - e) + a (-b + f)) ArcTan[(-a + d - e)/
Sqrt[-(d - e)^2 + a (b + c^2 - 2 f)]])/
Sqrt[-(d - e)^2 +
a (b + c^2 - 2 f)] + ((-b e + d f) ArcTan[(b - f)/Sqrt[
b c^2 - f^2]])/Sqrt[
b c^2 - f^2] + ((-b e + d f) ArcTan[f/Sqrt[b c^2 - f^2]])/Sqrt[
b c^2 - f^2] + ((a b - d^2 + b e -
d f) (ArcTan[(b - d - f)/Sqrt[b (a + c^2 + 2 e) - (d + f)^2]] +
ArcTan[(d + f)/Sqrt[b (a + c^2 + 2 e) - (d + f)^2]]))/Sqrt[
a b + b (c^2 + 2 e) - (d + f)^2]);
At first we must check restrictions:
-1 < ((b e - d f) Im[1/Sqrt[a b c^2 - c^2 d^2 - b e^2 + 2 d e f - a f^2]])/Sqrt[b] < 1 &&
b c^2 > f^2 && (d + f)^2 < b (a + c^2 + 2 e) /. {a -> 1, c -> 2, e -> 1, f -> 2, d -> 1, b -> 2}
(*True *)(*OK*)
If false
then forumla gives complex number (Wrong answer!).
then:
F[a_, c_, e_, f_, d_, b_] := NIntegrate[1/(c^2 + 2*s*e + a*s^2 - 2*t*f - 2*s*t*d + b*t^2)^2, {t, 0, 1}, {s, 0, 1}]
F[1, 2, 1, 2, 1, 2]
(* 0.105123 *)
SOL[1, 2, 1, 2, 1, 2] // N
(* 0.105123 *)
Works as should it.
For some values use Limit
,because formula gives Power::infy: Infinite expression 1/0 encountered
At first check restrictions about parameters:
1 < ((b e - d f) Im[1/Sqrt[a b c^2 - c^2 d^2 - b e^2 + 2 d e f - a f^2]])/Sqrt[b] <
1 && b c^2 > f^2 && (d + f)^2 < b (a + c^2 + 2 e) /. {a -> 1, e -> 1, f ->
1, d -> 1, b -> 2}
(*-1 < Im[1/Sqrt[-1 + c^2]]/Sqrt[2] < 1 && 2 c^2 > 1 && 4 < 2 (3 + c^2)*)
Limit[Im[1/Sqrt[-1 + c^2]]/Sqrt[2], c -> 1, Direction -> -1]
(* 0 *)
-1 < 0 < 1 && 2 c^2 > 1 && 4 < 2 (3 + c^2) /. c -> 1
(*True*)
F[1, 1, 1, 1, 1, 2]
(* 0.803374 *)
SOL[1, 1, 1, 1, 1, 2](* errors *)
Limit[SOL[1, c, 1, 1, 1, 2], c -> 1] // N
(* 0.803374 *)
Bonus Extra:
With a small changes:
s4 = Limit[s3, s -> 1, Assumptions -> {e ∈ Reals, c ∈ Reals, a ∈ Reals, f ∈ Reals, d ∈ Reals, b ∈ Reals}]-
Limit[s3, s -> 0, Assumptions -> {e ∈ Reals, c ∈ Reals, a ∈ Reals, f ∈ Reals,
d ∈ Reals,b ∈ Reals}]//Simplify
(* solution *)
SOL2[a_, c_, e_, f_, d_, b_] := (1/(
2 (a b c^2 - c^2 d^2 - b e^2 + 2 d e f -
a f^2)))(((d e - a f) ArcTan[e/Sqrt[a c^2 - e^2]])/Sqrt[
a c^2 - e^2] + ((-d e + a f) ArcTan[(a + e)/Sqrt[a c^2 - e^2]])/
Sqrt[a c^2 -
e^2] + ((d (-d + e) + a (b - f)) ArcTan[(d - e)/
Sqrt[-(d - e)^2 + a (b + c^2 - 2 f)]])/
Sqrt[-(d - e)^2 +
a (b + c^2 - 2 f)] + ((d (d - e) + a (-b + f)) ArcTan[(-a + d -
e)/Sqrt[-(d - e)^2 + a (b + c^2 - 2 f)]])/
Sqrt[-(d - e)^2 +
a (b + c^2 - 2 f)] + ((-b e +
d f) (ArcTan[(b - f)/Sqrt[b c^2 - f^2]] +
ArcTan[f/Sqrt[b c^2 - f^2]]))/Sqrt[
b c^2 - f^2] + ((a b - d^2 + b e -
d f) (ArcTan[(b - d - f)/Sqrt[
a b + b (c^2 + 2 e) - (d + f)^2]] +
ArcTan[(d + f)/Sqrt[a b + b (c^2 + 2 e) - (d + f)^2]]))/Sqrt[
a b + b (c^2 + 2 e) - (d + f)^2]);
$$\int _0^1\int _0^1\frac{1}{\left(c^2+2 s e+a s^2-2 t f-2 s t d+b
t^2\right)^2}dtds=\\\frac{\frac{(d e-a f) \tan ^{-1}\left(\frac{e}{\sqrt{a
c^2-e^2}}\right)}{\sqrt{a c^2-e^2}}+\frac{(-d e+a f) \tan ^{-1}\left(\frac{a+e}{\sqrt{a
c^2-e^2}}\right)}{\sqrt{a c^2-e^2}}+\frac{(d (-d+e)+a (b-f)) \tan
^{-1}\left(\frac{d-e}{\sqrt{-(d-e)^2+a \left(b+c^2-2 f\right)}}\right)}{\sqrt{-(d-e)^2+a
\left(b+c^2-2 f\right)}}+\frac{(d (d-e)+a (-b+f)) \tan
^{-1}\left(\frac{-a+d-e}{\sqrt{-(d-e)^2+a \left(b+c^2-2
f\right)}}\right)}{\sqrt{-(d-e)^2+a \left(b+c^2-2 f\right)}}+\frac{(-b e+d f) \left(\tan
^{-1}\left(\frac{b-f}{\sqrt{b c^2-f^2}}\right)+\tan ^{-1}\left(\frac{f}{\sqrt{b
c^2-f^2}}\right)\right)}{\sqrt{b c^2-f^2}}+\frac{\left(a b-d^2+b e-d f\right) \left(\tan
^{-1}\left(\frac{b-d-f}{\sqrt{a b+b \left(c^2+2 e\right)-(d+f)^2}}\right)+\tan
^{-1}\left(\frac{d+f}{\sqrt{a b+b \left(c^2+2 e\right)-(d+f)^2}}\right)\right)}{\sqrt{a
b+b \left(c^2+2 e\right)-(d+f)^2}}}{2 \left(a b c^2-c^2 d^2-b e^2+2 d e f-a f^2\right)}$$
Formula for:
$\{e\in \mathbb{R},c\in \mathbb{R},a\in \mathbb{R},f\in \mathbb{R},d\in \mathbb{R},b\in \mathbb{R}\}$
with restrictions:
$b c^2-f^2>0\land (d+f)^2<b \left(a+c^2+2 e\right)$
Reduce[b c^2 > f^2 && (d + f)^2 < b (a + c^2 + 2 e)]
$$(d|e|f)\in \mathbb{R}\land \left(\left(c<0\land b>\frac{f^2}{c^2}\land a>\frac{-b c^2-2 b e+d^2+2 d f+f^2}{b}\right)\lor \left(c>0\land b>\frac{f^2}{c^2}\land a>\frac{-b c^2-2 b
e+d^2+2 d f+f^2}{b}\right)\right)$$
Assumptions
options are not going to work. I'm not really giving high hopes on improving calculation time, but I'd suggest writing this asIntegrate[1/(c^2 + 2*s*e + a*s^2 - 2*t*f - 2*s*t*d + b*t^2)^2, {s, 0, 1}, {t, 0, 1}, Assumptions -> Element[a | b | d | e | f, Reals]]
. (You could also group them asElement[a, Reals] && Element[b, Reals] && ...
.) Did you possibly forget to includec
in the assumptions? $\endgroup$Assumptions
options is going to causeIntegrate
pick only one of them. $\endgroup$