On Saturday, February 4, 2017 at 8:48:22 PM UTC, [email protected] wrote:
>
> I would like to know the right way to do in SAGE what I am currently doing 
> with Mathematica in these two examples (I actually know how to do the first 
> one in SAGE, but probably not in the best way):
> 1) Finding the intersection of a generic tangent line to f(x) with f(x):
> f[x_]:= x^2(x^2-1)
> L[a_,x_]:=f[a]+f'[a](x-a)
> Solve[L[a,x]==f[x],x]
> Here the main issue for me is how use the derivative f'(x) without having 
> to define a new function g(x)=derivative(f(x))
>

Are your f always polynomials? Sage can do much more with polynomials then 
with "generic" symbolic functions.
(e.g. for intersecting plane curves an exact approach would be to compute 
the resultant, etc)

Regarding your last question, certainly there is no need to define a new 
named function for everything, e.g.
sage: f(x)=x^2
sage: f.diff(x)
x |--> 2*x
sage: f.diff(x)(5)
10

works
 

>
> 2) Testing if |f(z)| < f(|z|) for various choices of f:
> Pl[f_,r_]:=Plot[Abs[f[r Exp[I t]]]/f[r],{t,0,2Pi}]
> Here I am mostly interested in how to write a command that uses a function 
> as a variable. 
>

Sage has two different types of "functions": 1) native Python functions 2) 
symbolic functions;
certainly both of these can be passed around as parameters.

 

>
> Thanks for any suggestions.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to