Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

- Index
- » Computer Math
- »
**Sage**

Pages: **1**

`Solve[Sqrt[x-1]-Sqrt[x+1] +1==0,x]`

The above is Mathematica code. How do I solve that equation with Sage?

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

I'm not crazy, my mother had me tested.

Offline

**ShivamS****Member**- Registered: 2011-02-07
- Posts: 3,646

solve(sqrt(x-1)-sqrt(x+1) +1==0,x)

Sorry, this doesn't work. Haven't used Sage in a long time after switching to Mathematica. I don't know why it doesn't work though...

*Last edited by ShivamS (2014-04-03 13:54:29)*

Offline

I've tried that. I can't solve this equation with Maxima either.

Only gAr can tell

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

I'm not crazy, my mother had me tested.

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi,

Its syntax is

`solve([sqrt(x-1)-sqrt(x+1)==-1],x)`

But it doesn't solve it though, Sage and maxima seems to have a problem when square roots are involved like that.

That has frustrated me a few times.

So we need to either manually eliminate the roots or write a program to eliminate roots, and then give that equation to solve.

Introduces some extra solutions, so we need to weed out the extras later.

For now, use this input instead:

`solve([(8*sqrt(x + 1)*sqrt(x - 1)*x)^2==(8*x^2 - 5)^2],x)`

[x == (-5/4), x == (5/4)]

So, for the original equation, x=5/4

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

How did you get this equation?

`[(8*sqrt(x + 1)*sqrt(x - 1)*x)^2==(8*x^2 - 5)^2]`

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

I'm not crazy, my mother had me tested.

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Ah, I was using the code from here

Did not eliminate sqrt completely, so needs to be modified.

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Wait, an easier workaround!

`solve([y==sqrt(x-1),y==sqrt(x+1)-1],x,y)`

[[x == (5/4), y == (1/2)]]

which is just perfect!

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

Why does the simplest idea not work but the complicated ones do?

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

I'm not crazy, my mother had me tested.

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Why does the simplest idea not work but the complicated ones do?

Why, wan't #7 simple?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

Yes, It was.

I am only curious

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

I'm not crazy, my mother had me tested.

Offline

Pages: **1**

- Index
- » Computer Math
- »
**Sage**