ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 31 Dec 2017 16:58:45 +0100How to solve this equation with double square root?https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/I am trying to solve this equation in sage
$$
\sqrt{-4 \, z^{2} + 2 \, \sqrt{-4 \, z^{2} + 1} - 1} = 0.
$$
But when I try the code
var('z')
eq = sqrt(-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1) == 0
solve(eq,z)
I get
[z == -1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1), z == 1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1)]
Is there any way to actually solve it in sage?Sun, 31 Dec 2017 02:00:00 +0100https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/Comment by ablmf for <p>I am trying to solve this equation in sage
$$
\sqrt{-4 \, z^{2} + 2 \, \sqrt{-4 \, z^{2} + 1} - 1} = 0.
$$
But when I try the code</p>
<pre><code>var('z')
eq = sqrt(-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1) == 0
solve(eq,z)
</code></pre>
<p>I get</p>
<pre><code>[z == -1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1), z == 1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1)]
</code></pre>
<p>Is there any way to actually solve it in sage?</p>
https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?comment=40387#post-id-40387This has two solutions in $\mathbb C$, $\pm \sqrt{2\sqrt{3}-3}/2$.Sun, 31 Dec 2017 02:12:49 +0100https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?comment=40387#post-id-40387Comment by slelievre for <p>I am trying to solve this equation in sage
$$
\sqrt{-4 \, z^{2} + 2 \, \sqrt{-4 \, z^{2} + 1} - 1} = 0.
$$
But when I try the code</p>
<pre><code>var('z')
eq = sqrt(-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1) == 0
solve(eq,z)
</code></pre>
<p>I get</p>
<pre><code>[z == -1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1), z == 1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1)]
</code></pre>
<p>Is there any way to actually solve it in sage?</p>
https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?comment=40385#post-id-40385To better specify the question, do you want to solve for $z$ in $\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$, other?Sun, 31 Dec 2017 02:04:55 +0100https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?comment=40385#post-id-40385Comment by slelievre for <p>I am trying to solve this equation in sage
$$
\sqrt{-4 \, z^{2} + 2 \, \sqrt{-4 \, z^{2} + 1} - 1} = 0.
$$
But when I try the code</p>
<pre><code>var('z')
eq = sqrt(-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1) == 0
solve(eq,z)
</code></pre>
<p>I get</p>
<pre><code>[z == -1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1), z == 1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1)]
</code></pre>
<p>Is there any way to actually solve it in sage?</p>
https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?comment=40386#post-id-40386One thing to notice is that $\sqrt{\operatorname{expression}} = 0$ is equivalent to $\operatorname{expression} = 0$.
This gets you rid of one of the square roots.Sun, 31 Dec 2017 02:05:41 +0100https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?comment=40386#post-id-40386Comment by slelievre for <p>I am trying to solve this equation in sage
$$
\sqrt{-4 \, z^{2} + 2 \, \sqrt{-4 \, z^{2} + 1} - 1} = 0.
$$
But when I try the code</p>
<pre><code>var('z')
eq = sqrt(-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1) == 0
solve(eq,z)
</code></pre>
<p>I get</p>
<pre><code>[z == -1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1), z == 1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1)]
</code></pre>
<p>Is there any way to actually solve it in sage?</p>
https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?comment=40395#post-id-40395If an answer solves your question, please accept it by clicking the "accept" button
(the one with a check mark, below the upvote button, score, and downvote button,
at the top left of the answer).
This will mark the question as solved in the list of questions on the main page
of Ask Sage, as well as in lists of questions related to a particular query.Sun, 31 Dec 2017 16:58:45 +0100https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?comment=40395#post-id-40395Answer by slelievre for <p>I am trying to solve this equation in sage
$$
\sqrt{-4 \, z^{2} + 2 \, \sqrt{-4 \, z^{2} + 1} - 1} = 0.
$$
But when I try the code</p>
<pre><code>var('z')
eq = sqrt(-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1) == 0
solve(eq,z)
</code></pre>
<p>I get</p>
<pre><code>[z == -1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1), z == 1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1)]
</code></pre>
<p>Is there any way to actually solve it in sage?</p>
https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?answer=40388#post-id-40388To better specify the question, one would need to say if we want to solve
for $z$ in $\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$, or other.
Here we examine how to solve over $\mathbb{C}$.
Define $z$ as a symbolic variable, and define the equation (as you did).
sage: z = SR.var('z')
sage: eq_a = sqrt(-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1) == 0
sage: solve(eq_a, z)
[z == -1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1), z == 1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1)]
First notice that $\sqrt{\operatorname{expression}} = 0$ is equivalent to $\operatorname{expression} = 0$.
This gets you rid of one of the square roots.
sage: eq_b = eq_a^2
sage: eq_b
-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1 == 0
Then isolate the other square root.
sage: eq_c = eq_b + 4*z^2 + 1
sage: eq_c
2*sqrt(-4*z^2 + 1) == 4*z^2 + 1
Remove it by squaring. Note that the new equation is implied by the initial one, but no longer equivalent to it.
sage: eq_d = eq_c^2
sage: eq_d
-16*z^2 + 4 == (4*z^2 + 1)^2
Solve the new equation.
sage: sols_d = solve(eq_d, z)
sage: sols_d
[z == -1/2*sqrt(2*sqrt(3) - 3), z == 1/2*sqrt(2*sqrt(3) - 3), z == -1/2*sqrt(-2*sqrt(3) - 3), z == 1/2*sqrt(-2*sqrt(3) - 3)]
Check which of the solutions are solutions of the initial equation.
sage: [bool(eq_a.subs(s)) for s in sols_d]
[True, True, False, False]
Define the solutions of the original equation:
sage: sols_a = [s for s in sols_d if bool(eq_a.subs(s))]
sage: sols_a
[z == -1/2*sqrt(2*sqrt(3) - 3), z == 1/2*sqrt(2*sqrt(3) - 3)]Sun, 31 Dec 2017 02:19:55 +0100https://ask.sagemath.org/question/40384/how-to-solve-this-equation-with-double-square-root/?answer=40388#post-id-40388