# [Maxima] Symbolic pseudo-inverse

Barton Willis willisb at unk.edu
Mon Aug 24 17:52:01 CDT 2009

```This bug is due to a limit bug:

(%i38) e : (2*sin(x)*z+cos(x)*sin(2*x)-2*cos(x)^2*sin(x))/(z^2+(-sin
(2*x)^2-4*sin(x)^2-cos(x)^2-1)*z+sin(2*x)^2-4*cos(x)*sin(x)*sin(2*x)+4*cos
(x)^2*sin(x)^2);

(%o38) (2*sin(x)*z+cos(x)*sin(2*x)-2*cos(x)^2*sin(x))/(z^2+(-sin
(2*x)^2-4*sin(x)^2-cos(x)^2-1)*z+sin(2*x)^2-4*cos(x)*sin(x)*sin(2*x)+4*cos
(x)^2*sin(x)^2)

Bogus:

(%i39) limit(e,z,0);
(%o39) cos(x)/(sin(2*x)-2*cos(x)*sin(x))

(%i40) trigexpand(%);
Division by 0 -- an error.  To debug this try debugmode(true);

Correct, I think:

(%i41) limit(trigexpand(e),z,0);
(%o41) -(2*sin(x))/((4*cos(x)^2+4)*sin(x)^2+cos(x)^2+1)

(%i42) trigexpand(%);
(%o42) -(2*sin(x))/((4*cos(x)^2+4)*sin(x)^2+cos(x)^2+1)

Barton

-----maxima-bounces at math.utexas.edu wrote: -----

>This seems to work nicely except for one very big problem: it does not
>check for expression zero equivalence except syntactically.  See below for
>an example.
>
>              -s
>

```