## 175 Reputation

8 years, 347 days

## is it possible to improve the code so it...

is it possible to improve the code so it posts positive coefficients

expMod(2*x^21 - 3*x^7 + 10*x^3 - 18,17);

to output 14*x^7 + 2*x^4 + 10*x^3 +16

## sin^(3)(x)...

@nm sin^(3) (x) seems like bad notation, since we reserve f ^(n) for the n'th derivative of a function

## not instantaneous but fast...

instantaneous might be stretching it , but it takes about a second

## Thankyou!...

@acer Thanks. And I like how you answered it in two different ways. I feel stupid, I must have missed some key info in the help page.

## Just checking...

@rlopez

I checked the student calculus 1 package, it does not have second derivative test.

But I found it with this command:

with(Student[MultivariateCalculus]);

This is a very useful package.
Thanks i will use this in the future.

Why does 'multiplying both sides by the denominator' make rsolve work?

Also I am curious about what the effect of appending "makeproc" does.

I tried to replicate the action using a function.

Without makeproc:

restart:
SP:=n->rsolve({S(n)-S(n-1) = 2*S(n)^2/(2*S(n)-1), S(1)=1}, {S(n)}):
SP(10);
>Error, (in rsolve/single) argument 10 in function S(10) is not a name

With makeproc, it works, but then SP(n) doesnt work.

restart:
SP:=rsolve({S(n)-S(n-1) = 2*S(n)^2/(2*S(n)-1), S(1)=1}, {S(n)},makeproc):
SP(10);
>1/19

SP(n);
>Error, (in SP) input must be an integer

Why doesn't SP(n) work?

I simplified S(n)-S(n-1))*(2*S(n)-1)=2*S(n)^2 and solved for S(n).

but strangely

restart: A:=rsolve({S(n)= S(n-1)/(1+2*S(n-1)),S(1)=1}, {S(n)});

restart: A:=rsolve({S(n)*(1+2*S(n-1)) = S(n-1),S(1)=1}, {S(n)});

This appears to be the multiplying by denominator approach.

Thanks guys, very clever solution.

## These are great suggestions. ...

These are great suggestions.

## Nice work!...

Useful program.
I would love to learn how to make applets like this for statistical hypothesis testing.

## Did you use them in previous calculation...

It may be that r_i and theta_j were previously defined.

Check r_i or r__i and theta__j  , seperately on a new line.

## I guess i will have to double check my r...

Setting Digits:=20 is sufficient hopefully.

## Update, it seems that Maple 2018 may or...

Maple int(int(int ( ) ) ) versus int( ) . The latter evaluates the outermost bounds, the former does not.

@Kitonum Thanks.

I was able to integrate it with cylindrical and spherical

## Thanks, i changed the code...

@Fabio92 I changed the code so we don't evaluate a non-integer subscript. How is this?

medianmean:= proc(x) local a,b,c,d,g;
a:=sort(x);
b:=nops(x);
c:=nops(x)/2;
d:=(nops(x)+1)/2;
if (b mod 2 = 0) then
evalf([a,(a[c]+a[c+1])/2,g]) ;
else
evalf([a,a[d],g]);
end if;
end proc:

Alternatively i can put the m inside the 'if then' body.

medianmean:= proc(x) local a,b,c,d,g,m;
a:=sort(x);
b:=nops(x);
c:=nops(x)/2;
d:=(nops(x)+1)/2;
if (b mod 2 = 0) then
m:=  (a[c]+a[c+1])/2;
evalf([a,m,g]) ;
else
evalf([a,a[d],g]);
end if;
end proc:

## Thanks for the reply. C...

Thanks for the reply. So by setting y(x) = y in your subs statement, that tells maple to treat y(x) like a regular variable.

Question. When you say ' the explicit dependence of  y(x)  is unknown ' you mean maple doesn't know in what way y depends on x. For example y(x) could equal to x^2

Your help is very much appreciated.

 1 2 3 4 5 Page 2 of 5
﻿