Question: modification of expression

Hello people in mapleprimes,

I want to ask a question about modification of expression.

Basically, what I want to do is to change the expression of sqrt((-a)^2) to sqrt(a^2).

 

The expression I want to modify is this:

 

aa:=phi[n, j] = a[j, D]-a-sqrt((-a[j, D]+a+tau[n, j])^2+4*gamma*f[c, n, j]/L[j])

 

I want to change this to 

 

phi[n, j] = a[j, D]-a-sqrt((a[j, D]-a-tau[n, j])^2+4*gamma*f[c, n, j]/L[j])

 

To do this, I wrote as 

subs(sqrt((-a[j, D]+a+tau[n, j])^2+4*gamma*f[c, n, j]/L[j]) = sqrt((a[j, D]-a-tau[n, j])^2+4*gamma*f[c, n, j]/L[j]), phi[n, j] = a[j, D]-a-((-a[j, D]+a+tau[n, j])^2+4*gamma*f[c, n, j]/L[j])^(1/2))

 

Or, I wrote as 

subs(op([2,3,2,1,1],aa)=(a[j, D]-a-tau[n, j])^2,aa)

 

If there is better ways, please tell me them.

 

Best wishes.

 

taro

 

Please Wait...