> If that would take you a lot of time then I have very little chance
> of figuring it out on my own.
Can you answer the question *why* you want to have such a transformation
of your expression?
Do you know any other CAS that can do such easily?
> Looks like computer algebra systems are not the right tool to do
> elementary algebra.
It depends on what you mean by "elementary algebra". As Waldek said,
there are two different aspects: (A) computing the correct result, (B)
showing it in a nice form.
It is actually (A) that is important. And whether a CAS gives you
(a+b)*c back or a*c+b*c should be irrelevant. They are equal and both
correct. Some CAS work on general expressions and focus on transforming
such expressions. FriCAS on the contrary does mainly (A) and if you want
(B), you have to convert to some respective type where the normal form
of this type prints in such a form that the user wants.
If you just aim at (B), you disregard a lot of the actual capabilities
of a CAS.
> What kind of software is more suitable for transforming algebraic
> expressions?
Well, should be a CAS. Maybe you start reading about the beginning of
computer algebra systems. Transforming *huge* expressions was one of
the orignal tasks of a CAS. Maybe you look at Reduce
http://www.reduce-algebra.com/. It has an overwhelmingly lot of options
to transform expressions into the way you like it. It was too much for
my taste, but your mileage may vary.
> Or do human beings have to do it on paper despite all
> the hype how artificial "intelligence" and other fruits of
> digitalization make humans obsolete?
Maybe you describe what your actual problem is that you want to solve.
A much more interesting problem would be: find formula for all solutions
of x^3 + p*x + q = 0 (depending on some variables p and q) or factor
x^4 - 1 over the integers or over a finite field of prime order or over
the Gaussion integers.
Look at
https://fricas.github.io/fricas-notebooks/index.html for some
examples or browse through The FriCAS book
https://fricas.github.io/book.pdf in order to give you an impression
what a computer algebra system can do.
I hope that helps even if I refuse to transform your expression.
BTW, if it were only *one* transformation (and not two), you would have
probably figured out the following yourself.
eq := c^2 = a^2 + b^2 -(2*a*b)*cos(gamma)
ex := rhs eq
ex2 := subst(ex,[a=(l+k)/2,b=(l-k)/2,_
cos(gamma)=sin(gamma)/tan(gamma/2)-1])
Dkl ==> DistributedMultivariatePolynomial([k,l],Expression Integer)
ex2 :: Dkl
or you can let FriCAS translate your cos into tan with half angles.
(4) -> normalize(ex2)
2 gamma 2 2
l tan(-----) + k
2
(4) ------------------
gamma 2
tan(-----) + 1
2
Type: Expression(Integer)
Interestingly, by using normalize, you don't even have to add "::Dkl"
to make the output separate k and l.
Ralf