# Revision history [back]

### How to force the substitution since subs is not working?

Blockquote

Blockquote dkkr1 = 2Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)beta_1/(c^2gamma_1^2 + (alpha_1^2 + beta_1^2)c^2 - v2^2) - 2(-Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)alpha_1^2c^4 - Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)c^4gamma_1^2 + (Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)beta_1^2v1^2 + Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)c^2)v2^2)Delta/(c^6gamma_1^4 + 2(alpha_1^2 + beta_1^2)c^6gamma_1^2 + (alpha_1^4 + 2alpha_1^2beta_1^2 + beta_1^4)c^6 + ((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)v2^4 + (c^4gamma_1^6 + 3(alpha_1^2 + beta_1^2)c^4gamma_1^4 + 3(alpha_1^4 + 2alpha_1^2beta_1^2 + beta_1^4)c^4gamma_1^2 + (alpha_1^6 + 3alpha_1^4beta_1^2 + 3alpha_1^2beta_1^4 + beta_1^6)c^4)v1^2 - 2(c^4gamma_1^2 + (alpha_1^2 + beta_1^2)c^4 + (c^2gamma_1^4 + 2(alpha_1^2 + beta_1^2)c^2gamma_1^2 + (alpha_1^4 + 2alpha_1^2beta_1^2 + beta_1^4)c^2)v1^2)v2^2)

dkkr1= dkkr1.subs(sqrt(1- alpha_1^2 - beta_1^2) == gamma_1) show(dkkr1)

Blockquote

As you can see, I have an expression containing alpha_1, beta_1, gamma_1. They are normalized by this constraint alpha_1^2+beta_1^2+gamma_1^2=1

That would simplify the expression. Somehow subs doesn't work.

I am new to Sagemath and would love to learn how to me this work.

Thanks

### How to force the substitution since subs is not working?

Blockquote

Blockquote

dkkr1 = 2Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)beta_1/(c^2gamma_1^2 + (alpha_1^2 + beta_1^2)c^2 2*I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1/(c^2*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^2 - v2^2) - 2(-Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)alpha_1^2c^4 - Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)c^4gamma_1^2 + (Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)beta_1^2v1^2 + Ipisqrt(-c^2gamma_1^2 - (alpha_1^2 + beta_1^2)c^2 + v2^2)sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)c^2)v2^2)Delta/(c^6gamma_1^4 + 2(alpha_1^2 + beta_1^2)c^6gamma_1^2 2*(-I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*alpha_1^2*c^4 - I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^4*gamma_1^2 + (I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1^2*v1^2 + I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^2)*v2^2)*Delta/(c^6*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^6*gamma_1^2 + (alpha_1^4 + 2alpha_1^2beta_1^2 + beta_1^4)c^6 2*alpha_1^2*beta_1^2 + beta_1^4)*c^6 + ((alpha_1^2 + beta_1^2 + gamma_1^2)v1^2 + c^2)v2^4 + (c^4gamma_1^6 + 3(alpha_1^2 + beta_1^2)c^4gamma_1^4 + 3gamma_1^2)*v1^2 + c^2)*v2^4 + (c^4*gamma_1^6 + 3*(alpha_1^2 + beta_1^2)*c^4*gamma_1^4 + 3*(alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^4*gamma_1^2 + (alpha_1^6 + 3*alpha_1^4*beta_1^2 + 3*alpha_1^2*beta_1^4 + beta_1^6)*c^4)*v1^2 - 2*(c^4*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^4 + (c^2*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^2*gamma_1^2 + (alpha_1^4 + 2alpha_1^2beta_1^2 + beta_1^4)c^4gamma_1^2 + (alpha_1^6 + 3alpha_1^4beta_1^2 + 3alpha_1^2beta_1^4 + beta_1^6)c^4)v1^2 - 2(c^4gamma_1^2 + (alpha_1^2 + beta_1^2)c^4 + (c^2gamma_1^4 + 2(alpha_1^2 + beta_1^2)c^2gamma_1^2 + (alpha_1^4 + 2alpha_1^2beta_1^2 + beta_1^4)c^2)v1^2)v2^2) 2*alpha_1^2*beta_1^2 + beta_1^4)*c^2)*v1^2)*v2^2)


dkkr1= dkkr1.subs(sqrt(1- alpha_1^2 - beta_1^2) == gamma_1) show(dkkr1)

Blockquote

As you can see, I have an expression containing alpha_1, beta_1, gamma_1. They are normalized by this constraint alpha_1^2+beta_1^2+gamma_1^2=1

That would simplify the expression. Somehow subs doesn't work.

I am new to Sagemath and would love to learn how to me this work.

Thanks

### How to force the substitution since subs is not working?

Blockquote

dkkr1 = 2*I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1/(c^2*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^2 - v2^2) - 2*(-I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*alpha_1^2*c^4 - I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^4*gamma_1^2 + (I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1^2*v1^2 + I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^2)*v2^2)*Delta/(c^6*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^6*gamma_1^2 + (alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^6 + ((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*v2^4 + (c^4*gamma_1^6 + 3*(alpha_1^2 + beta_1^2)*c^4*gamma_1^4 + 3*(alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^4*gamma_1^2 + (alpha_1^6 + 3*alpha_1^4*beta_1^2 + 3*alpha_1^2*beta_1^4 + beta_1^6)*c^4)*v1^2 - 2*(c^4*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^4 + (c^2*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^2*gamma_1^2 + (alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^2)*v1^2)*v2^2)


dkkr1= dkkr1.subs(sqrt(1- alpha_1^2 - beta_1^2) == gamma_1) show(dkkr1)

Blockquote

As you can see, I have an expression containing alpha_1, beta_1, gamma_1. They are normalized by this constraint alpha_1^2+beta_1^2+gamma_1^2=1

That would simplify the expression. Somehow subs doesn't work.

I am new to Sagemath and would love to learn how to me make this work.

Thanks

 4 None slelievre 16479 ●19 ●147 ●329 http://carva.org/samue...

### How to force the substitution since subs is not working?

Blockquote

dkkr1 = 2*I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1/(c^2*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^2 - v2^2) - 2*(-I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*alpha_1^2*c^4 - I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^4*gamma_1^2 + (I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1^2*v1^2 + I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^2)*v2^2)*Delta/(c^6*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^6*gamma_1^2 + (alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^6 + ((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*v2^4 + (c^4*gamma_1^6 + 3*(alpha_1^2 + beta_1^2)*c^4*gamma_1^4 + 3*(alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^4*gamma_1^2 + (alpha_1^6 + 3*alpha_1^4*beta_1^2 + 3*alpha_1^2*beta_1^4 + beta_1^6)*c^4)*v1^2 - 2*(c^4*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^4 + (c^2*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^2*gamma_1^2 + (alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^2)*v1^2)*v2^2)


dkkr1= dkkr1.subs(sqrt(1- alpha_1^2 - beta_1^2) == gamma_1) show(dkkr1)

Blockquote

As you can see,

I have an expression containing alpha_1, beta_1, gamma_1. alpha_1, beta_1, gamma_1.

They are normalized by this constraint alpha_1^2+beta_1^2+gamma_1^2=1the constraint alpha_1^2 + beta_1^2 + gamma_1^2 = 1.

That would simplify the expression. Somehow subs subs doesn't work.

After defining dkkr1 as

dkkr1 = 2*I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1/(c^2*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^2 - v2^2) - 2*(-I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*alpha_1^2*c^4 - I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^4*gamma_1^2 + (I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1^2*v1^2 + I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^2)*v2^2)*Delta/(c^6*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^6*gamma_1^2 + (alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^6 + ((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*v2^4 + (c^4*gamma_1^6 + 3*(alpha_1^2 + beta_1^2)*c^4*gamma_1^4 + 3*(alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^4*gamma_1^2 + (alpha_1^6 + 3*alpha_1^4*beta_1^2 + 3*alpha_1^2*beta_1^4 + beta_1^6)*c^4)*v1^2 - 2*(c^4*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^4 + (c^2*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^2*gamma_1^2 + (alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^2)*v1^2)*v2^2)


I try to substitute

dkkr1= dkkr1.subs(sqrt(1- alpha_1^2 - beta_1^2)  ==  gamma_1)
show(dkkr1)


I am new to Sagemath SageMath and would love to learn how to make this work.

Thanks