Ask Your Question

bentheteacher's profile - activity

2018-11-15 18:15:10 +0200 commented answer solve() is not giving the right solutions

I figured that it would cancel each other, but i wasnt aware of the simplify-method. Thank you, im going to try this! :)

e: im still wondering if it should be this way. If i test this with "in RR" i get false which is not true as u said yourself... thats kinda odd

2018-11-15 15:18:40 +0200 received badge  Editor (source)
2018-11-15 15:17:54 +0200 asked a question solve() is not giving the right solutions

Hey there,

i need your help on this one. The following sage code is giving me a headache:

  • f(x) = x^3 + x^2 - 0.1
  • solve(f==0, x)
  • -->
  • [x == -1/2(1/180Isqrt(13)sqrt(3) + 7/540)^(1/3)(Isqrt(3) + 1) - 1/18(-Isqrt(3) + 1)/(1/180Isqrt(13)sqrt(3) + 7/540)^(1/3) - 1/3, x == -1/2(1/180Isqrt(13)sqrt(3) + 7/540)^(1/3)(-Isqrt(3) + 1) - 1/18(Isqrt(3) + 1)/(1/180Isqrt(13)sqrt(3) + 7/540)^(1/3) - 1/3, x == (1/180Isqrt(13)sqrt(3) + 7/540)^(1/3) + 1/9/(1/180Isqrt(13)sqrt(3) + 7/540)^(1/3) - 1/3]

So i'm getting these 3 solutions, but they are not in R (real numbers), which they should be. Im figuring there is some problem with really long terms or something? Is there an easy solution for this? Is the solve()-method here working as intended?

Regards, Ben

2018-07-31 17:24:11 +0200 commented answer Is there a way to use sage-boolean-values in Latex

Thanks for your answer. I already got to that workaround myself in the meantime.

So the bottom line for this kind of problem is:

Do all the logic in python right? :)

2018-07-31 17:23:50 +0200 answered a question Is there a way to use sage-boolean-values in Latex

Thanks for your answer. I already got to that workaround myself in the meantime.

So the bottom line for this kind of problem is:

Do all the logic in python right? :)

2018-07-31 17:22:54 +0200 received badge  Scholar (source)
2018-07-31 17:22:53 +0200 received badge  Supporter (source)
2018-07-25 01:15:45 +0200 received badge  Student (source)
2018-07-25 00:31:41 +0200 asked a question Is there a way to use sage-boolean-values in Latex

Hey there,

im completely new to sage and so far i got along quite well, but i can't figure this one out. I want to create randomized mathproblems and i want latex to decide what to print depending on calculations in sage.

So here is a functional minimal example:

\documentclass{article}
\usepackage{sagetex}
\begin{document}
    \begin{sagesilent}
        a = ZZ.random_element(1,20)
        b = ZZ.random_element(1,20)
    \end{sagesilent}
    $\sage{a}-\sage{b}$
\end{document}

What do i need to do if i want to switch a and b depending on if the result is negative or not?