> Yes, coefficients are diffrent.
I think this is because in the recursion, you wrote this:
[...] else f(F(n-1,c,z),c) [...]
when you actually meant this:
[...] else f(F(n-1,z,c),c) [...]
Viktor
-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Adam Majewski
Sent: Saturday, May 31, 2008 7:37 AM
To: maxima at math.utexas.edu
Subject: Re: [Maxima] diff
Robert Dodier pisze:
> On 5/27/08, Adam Majewski <adammaj1 at o2.pl> wrote:
>
>> >> f(z,c):=z*z+c$
>> >> F(n, z, c) :=
>> >> if n=1 then f(z,c)
>> >> else f(F(n-1, c, z),c)$
>> >> diff(F(n,z,c),z);
>
> Well, how about this.
>
> f (z, c) := z^2 + c;
> F (n, z, c) := if integerp (n) then if n = 1 then f (z, c) else f (F
> (n - 1, c, z), c) else 'F (n, z, c);
> m (n, z, c) := at (diff (F (n, 'z, c), 'z), 'z = z);
>
> I've made use of a couple of tricks here.
> (1) use integerp to protect the recursion; if not a literal integer,
> return a noun expression.
> (2) use at to evaluate the derivative for a given value of z,
> otherwise Maxima complains if z is something other than a symbol.
>
> With the functions as defined above I get this:
>
> m (3, z1, c1);
> => 2*(4*z1*(z1^2+c1)+1)*((z1^2+c1)^2+z1)
> expand (%);
> => 8*z1^7+24*c1*z1^5+10*z1^4+24*c1^2*z1^3+12*c1*z1^2
> +8*c1^3*z1+2*z1+2*c1^2
>
> I seem to be getting different coefficients than you; dunno what's up with
that.
>
> HTH
>
> Robert Dodier
Thx for help.
Yes, coefficients are diffrent.
I have checked it manually for n=2
If I'm not wrong :
f(f(z))=z^4+2cz^2+c+2+c
so diff should be :
diff=4z^3+4cz
as in my version. Your gives diffrent result:
2*z+2*c^2
?????
Help still wellcome.
Adam
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima