I appear not to be able to find a way to simplify the sums of fractions like the following example to their shortest representation.
For me shorteste representation means, to have as few as possible repeting terms. As a proxy to this I use LeafCount
, and thus want it minimized for expressions consisting of sums of fractions.
FullSimplify
fails to do much, just as using PowerExpand
as additional TransformationFunction
. Watch for yourself:
Here is the expression:
(-3 a - 2 a^3 + 4 Sqrt[1 + a^2] (5 - 9 Log[2]) +
4 a^2 Sqrt[1 + a^2] (5 - 9 Log[2]) +
12 (1 + a^2)^(3/2) Log[1 + Sqrt[1 + 1/a^2]] -
6 (4 (Sqrt[1 + a^2] - a (2 + a^2 - a Sqrt[1 + a^2])) Log[a] +
a Log[1 + a^2]))/(12 (1 + a^2)^(3/2) Sqrt[2 π])
$\frac{-2 a^3+4 \sqrt{a^2+1} a^2 (5-9 \log (2))+12 \left(a^2+1\right)^{3/2} \log \left(\sqrt{\frac{1}{a^2}+1}+1\right)-6 \left(4 \left(\sqrt{a^2+1}-a \left(a^2-\sqrt{a^2+1} a+2\right)\right) \log (a)+a \log \left(a^2+1\right)\right)+4 \sqrt{a^2+1} (5-9 \log (2))-3 a}{12 \sqrt{2 \pi } \left(a^2+1\right)^{3/2}}$
You can see that there are many repeating terms, and it is obvious that this cannot be the shortest form. And the following commands will not do anything to better the situation:
FullSimplify[%, Assumptions -> {a \[Element] Reals, a > 0}]
or
FullSimplify[%, Assumptions -> {a \[Element] Reals, a > 0},
TransformationFunctions -> {Automatic, PowerExpand}]
or even
FullSimplify[Together[Expand[%]], Assumptions -> {a \[Element] Reals, a > 0}]
My bet of where the issue is, is currently on Together
. It does something suboptimal (in terms of LeafCount
):
a/e + b/e + c/f + d/f // Together
yields:
(c e + d e + a f + b f)/(e f)
this thing can be further simplified with FullSimplify to the optimal result:
(a + b)/e + (c + d)/f
However this does obviously not work for my expression, I guess Together increases the LeafCount
so much, that FullSimplify
simply discards its intermediate results and goes without it.
Edit: I just found that there is some simplification done with:
FullSimplify[Apart[%]]
which yields the somewhat simplified expression:
(12 Log[1 + Sqrt[1 + 1/a^2]] - (
3 a + 2 a^3 - 20 (1 + a^2)^(3/2) + 36 (1 + a^2)^(3/2) Log[2] -
48 a Log[a] - 24 a^3 Log[a] + 24 (1 + a^2)^(3/2) Log[a] +
6 a Log[1 + a^2])/(1 + a^2)^(3/2))/(12 Sqrt[2 \[Pi]])
$\frac{12 \log \left(\sqrt{\frac{1}{a^2}+1}+1\right)-\frac{2 a^3-24 a^3 \log (a)-20 \left(a^2+1\right)^{3/2}+6 a \log \left(a^2+1\right)+24 \left(a^2+1\right)^{3/2} \log (a)+36 \left(a^2+1\right)^{3/2} \log (2)+3 a-48 a \log (a)}{\left(a^2+1\right)^{3/2}}}{12 \sqrt{2 \pi }}$
However the result is still not the shortest form, there is still obviously a simplier expresion possible.