btw: the previous output is _, you can write solve(_,x) on your line.

And another calculation could look like this, in other word, we have
in fact to solve quadratic equation.


sage: d = sqrt(x^2 + 5^2)
sage: D = sqrt((20-x)^2 + 10^2)
sage: T = d + D; T
sqrt(x^2 + 25) + sqrt((x - 20)^2 + 100)
sage: der=diff(T, x); der
(x - 20)/sqrt((x - 20)^2 + 100) + x/sqrt(x^2 + 25)
sage: eq=der.operands()[0]==-der.operands()[1]; eq=eq^2; eq;
(x - 20)^2/((x - 20)^2 + 100) == x^2/(x^2 + 25)
sage: eq=eq*eq.rhs().denominator(); eq=eq*eq.lhs().denominator(); eq
(x - 20)^2*(x^2 + 25) == ((x - 20)^2 + 100)*x^2
sage: eq=expand(eq); eq
x^4 - 40*x^3 + 425*x^2 - 1000*x + 10000 == x^4 - 40*x^3 + 500*x^2
sage: eq=eq.lhs()-eq.rhs(); eq
-75*x^2 - 1000*x + 10000
sage: solve(_,x)
[x == -20, x == (20/3)]
sage: der(x=-20)
-8/17*sqrt(17)
sage: der(x=20/3)
0


R.

On 6 dub, 19:03, "ma...@mendelu.cz" <ma...@mendelu.cz> wrote:
> Hi
>
> sage: solve((x - 20)/sqrt((x - 20)^2 + 100) + x/sqrt(x^2 + 25) == 0,
> x, to_poly_solve=True)
> [x == (20/3)]
>
> Robert M.
>
> On 6 dub, 15:09, Danread5 <danre...@me.com> wrote:
>
> > Hi all,
>
> > My first post...
>
> > I seem to be having trouble with solving for x in the following:
>
> > sage: d = sqrt(x^2 + 5^2)
> > sage: D = sqrt((20-x)^2 + 10^2)
> > sage: T = d + D; T
> > sqrt(x^2 + 25) + sqrt((x - 20)^2 + 100)
> > sage: diff(T, x)
> > (x - 20)/sqrt((x - 20)^2 + 100) + x/sqrt(x^2 + 25)
> > sage: solve((x - 20)/sqrt((x - 20)^2 + 100) + x/sqrt(x^2 + 25) == 0,
> > x)
> > [x == 20*sqrt(x^2 + 25)/(sqrt(x^2 + 25) + sqrt(x^2 - 40*x + 500))]
>
> > For some reason, Sage isn't solving completely for x, or isn't
> > 'seeing' the x^2...
>
> > Any help gladly appreciated!
>
> > Dan
>
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

To unsubscribe, reply using "remove me" as the subject.

Reply via email to