Alright, I finally have (k²(1+cos(γ))+l²(1-cos(γ)))/2 as a result of the following commands:
c_square := c^2=a^2+b^2-2*a*b*cos(gamma) a := a=(k+l)/2; b := b=(l-k)/2 ex1 := subst(rhs c_square,[a,b]) ex2 := ex1 :: DMP([k,l],Expression Integer) It's not that terrible if you know right commands. Now I want to use the tangent half-angle formulas: tan_plus := tan(gamma/2) = sin(gamma)/(1+cos(gamma)) tan_minus := tan(gamma/2) = (1-cos(gamma))/sin(gamma) How to make FriCAS substitute 1+cos(γ) and 1-cos(γ) in ex2 with sin(γ)/tan(γ/2) and sin(γ)tan(γ/2) respectively using tan_plus and tan_minus? -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/3cbCTizuzdakjOP111nS1IXAYJWoIcwvikgWH61zBW2zgJYjWoQ11jxe4KxwYKvTeyZ_O4c9MvLPbKyXLgv0sZqatfdXKFO236c7R2NsE7M%3D%40proton.me.