Thanks a lot, Simon!

Georg



On Wednesday, June 3, 2015 at 4:33:48 AM UTC+2, Simon King wrote:
>
> Hi Georg, 
>
> On 2015-06-02, ggrafendorfer <georg.gra...@gmail.com <javascript:>> 
> wrote: 
> > sage: g(x) = x^2 - 26*x -9 
> > sage: g.factor() 
> > x^2 - 26*x - 9 
>
> First of all, what you create is a symbolic function, so, factorisation 
> doesn't really make sense. 
>
>   sage: g(x) = x^2-26*x-9 
>   sage: g 
>   x |--> x^2 - 26*x - 9 
>
> What you probably want to factor is a symbolic expression that isn't a 
> function. Let's see if it works: 
>
>   sage: g = x^2-26*x-9 
>   sage: g 
>   x^2 - 26*x - 9 
>   sage: g.factor() 
>   x^2 - 26*x - 9 
>
> This time, the reason is that your expression lives in the symbolic 
> ring, which is so large that the notion of factorisation doesn't really 
> make sense (you could factor g as, say sin(x)*(g/sin(x))). 
>
>   sage: g.parent() 
>   Symbolic Ring 
>
> So, instead of working with general symbolic expressions, you should 
> work with actual polynomials, living in a polynomial ring with 
> prescribed coefficient domain. 
>
> Of course, the factorisation of your polynomial will depend on the 
> coefficient domain: 
>
>   sage: R.<x> = ZZ[] 
>   sage: R 
>   Univariate Polynomial Ring in x over Integer Ring 
>   sage: g = x^2-26*x-9 
>   sage: g.factor() 
>   x^2 - 26*x - 9 
>
> but when you work over the algebraic completion of QQ or if you work in 
> RR or some other large enough coefficient domain, then g factors: 
>
>   sage: R.<x> = QQbar[] 
>   sage: g = x^2-26*x-9 
>   sage: g.factor() 
>   (x - 26.34166406412634?) * (x + 0.3416640641263338?) 
>   sage: R.<x> = RR[] 
>   sage: g = x^2-26*x-9 
>   sage: g.factor() 
>   (x - 26.3416640641263) * (x + 0.341664064126334) 
>
> Best regards, 
> Simon 
>
>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to