[newbie] problem with determining modulus of complex quantity



>   Date: Thu, 21 Nov 2013 15:58:12 +0100
>   From: Hugo Coolens <hugo.coolens at kuleuven.be>
>
>   I defined the following function:
>   calpgon(m,s):=product(1/(s+4*(cos((k*%pi)/(2*m+1)))^2),k,1,m);
>
>   simplified it for the case m=3 like this:
>   trigrat(calpgon(3,s));
>					   1
>   (%o2)                         -------------------
>				   3      2
>				  s  + 5 s  + 6 s + 1
>
>
>   substituted s by i*omega like this
>
>   s : %i*omega;
>
>   tried to calculate the modulus of calpgon(3,i*omega) like this
>   abs(trigrat(calpgon(3,s)));
>
>   and got this:
>			!         3                     2    !
>			!%i (omega  - 6 omega) - 5 omega  + 1!
>   (%o4)               --------------------------------------
>			       6           4           2
>			  omega  + 13 omega  + 26 omega  + 1
>
>   however I hoped to get this "neater" form:
>					 1
>			 --------------------------------
>			 sqrt(omega^6+13 omega^4 +26 omega^2+1)
>
>   Can anyone here tell me how to make maxima go for the last expression?

(%i1) calpgon(m,s):=product(1/(s+4*(cos((k*%pi)/(2*m+1)))^2),k,1,m)$

(%i2) trigrat(calpgon(3,%i*?));
(%o2) (%i*(?^3-6*?)-5*?^2+1)/(?^6+13*?^4+26*?^2+1)

(%i3) ratsimp(cabs(%));
(%o3) 1/sqrt(?^6+13*?^4+26*?^2+1)

Leo