On 2/10/11 5:42 AM, Chris Sangwin wrote:
>
> Leon,
>
> First, I think your expression should be
>
> sqrt(a^2 - 2*a*b + b^2) + sqrt(a^2 + 2*a*b+b^2);
>
> What you need to do is get "inside the square roots", and to factor.
> The following code does this.
I learned the following from Stavros:
scanmap(factor, sqrt(a^2-2*a*b+b^2)+sqrt(a^2+2*a*b+b^2));
abs(b-a)+b+a.
Ray