The problem can always be solved as I know f(x,y,z) factors in this way.
Clearly this is possible to solve by hand. In fact if any problem can be
solved by a program it can be solved by hand. My problem is that I have
many large functions of this form for which I need to do this. I want to
automate this procedure.
Thanks for your advice and the advice from Stavros, I shall try it.
John.
Shahir Mowlaei wrote:
> I think that this problem cannot be solved in its general form. For example suppose that f(x,y,z) is a polynomial of degree, say, n in x, and on the other side you have h1=sin(x),h2=cos(x), and h3=any polynomial of h2 or x. Then this decomposition is evidently impossible.
> But if a problem of this kind is in principle solvable, and your functions are 'sufficiently' simple, then the following 'ugly' method 'might' work.
> First rearrange the functions h1,h2,... by decreasing complexity [log(g),g,1 or x^2,x,1 e.g.] and then use the following form
>
> first(divide(f(x,y,z),h1));first(divide(remainder(f(x,y,z),h1),h2));first(divide(remainder(remainder(f(x,y,z),h1),h2),h3));remainder(remainder(remainder(f(x,y,z),h1),h2),h3);
>
> where the first 3 lines give the coefficients of h1,h2,h3 respectively, and the last line would be zero if the decomposition is valid.
>
> But honestly, I think that the problems this method may solve, can be even solved by the naked eye.
>
> ~Shahir
>
> ------- Original Message -------
> From: John Reid <j.reid at mail.cryst.bbk.ac.uk>
> To: maxima at math.utexas.edu
> Sent: 13-Apr-08, 18:16:41
> Subject: Help factorising functions
>
> Hi,
>
> I'm sure this is straightforward enough yet I've not managed to work out
> how to do it so far from the documentation.
>
> I have several functions of several variables, for instance, f(x, y, z)
> which I know can be written in the following form:
>
> f(x, y, z) = g1(y, z) * h1(x) + g2(y, z) * h2(x) + g3(y, z) * h3(x)
>
> where h1(x), h2(x) and h3(x) are known. How to get maxima to produce
> g1(y, z), g2(y, z) and g3(y, z)?
>
> For instance
>
> f(x, mu, gamma): (- gamma * (x-mu)**2 - log(gamma) + log(2*%pi)) / 2
>
> So how can I ask maxima to decompose f as:
>
> g1(mu, gamma) * x**2 + g2(mu, gamma) * x + g3(mu, gamma)
>
> and
>
> g1(x, gamma) * mu**2 + g2(x, gamma) * mu + g3(x, gamma)
>
> and
>
> g1(x, mu) * log(gamma) + g2(x, mu) * gamma + g3(x, mu)
>
> Thanks in advance,
> John.
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima