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.Mon, 21 Jul 2014 19:15:59 +0200solving implicit equationhttps://ask.sagemath.org/question/23494/solving-implicit-equation/ Hi experts!
I want to resolve the equation: $A.sin(x)=B.(C-x)$
where A, C and B are constants, $0\leq x\leq \pi $, $A$ and $B$ are fixed, and $0\leq C\leq \pi $.
I want to obtain the analytic solution, $x=f(C)$, (if exist) for different values of $C$ and if only implicit solution exist, obtain the curve and and table with the values of:
$ x$ vs. $C$
How can I do that?
Waiting for your answer.
Thanks a lot!
Sat, 19 Jul 2014 15:53:05 +0200https://ask.sagemath.org/question/23494/solving-implicit-equation/Answer by Gregory Bard for <p>Hi experts!</p>
<p>I want to resolve the equation: $A.sin(x)=B.(C-x)$</p>
<p>where A, C and B are constants, $0\leq x\leq \pi $, $A$ and $B$ are fixed, and $0\leq C\leq \pi $.</p>
<p>I want to obtain the analytic solution, $x=f(C)$, (if exist) for different values of $C$ and if only implicit solution exist, obtain the curve and and table with the values of:</p>
<p>$ x$ vs. $C$</p>
<p>How can I do that?</p>
<p>Waiting for your answer.</p>
<p>Thanks a lot!</p>
https://ask.sagemath.org/question/23494/solving-implicit-equation/?answer=23505#post-id-23505 One option, and this might be suboptimal, is to replace sin(x) with its taylor series.
Because
sin(x) = x - (1/6)x^3 + (1/120)x^5 - (1/5040)x^7 + (1/362880)x^9 - O(x^11)
we would change
A*sin(x) = B*C - B*x
into instead
Ax - (A/6)x^3 + (A/120)x^5 - (A/5040)x^7 + (A/362880)x^9 - O(A x^11) = B*C - B*x
giving you then
-BC + (A+B)x - (A/6)x^3 + (A/120)x^5 - (A/5040)x^7 + (A/362880)x^9 - O(A x^11) = 0
or if you want a few more terms
-BC + (A+B)x - (A/3!)x^3 + (A/5!)x^5 - (A/7!)x^7 + (A/9!)x^9 - (A/11!)x^11 + (A/13!)x^13 + O(A x^15) = 0
This does reveal that varying C will only affect the answer by a constant.
If A and B were fixed constants, known in advance, then you could use "for" and "find_root" to find a
value of x for a long sequence of C values, forming a table of values.
For example:
http://sagecell.sagemath.org/?z=eJxtkEEOgjAQRfck3OEHN61AbCXGaNIFsPcImkZFG6XFWo3eXigukDiLyeT1zUzbp7QkylGgjGgYhEEueBgUXarfu-PtIZ0yGgJpMS0Rg-RxQacvpG01q-TeGavklWS0hdvMCwO88HgxtpceL8f2yuPV2Obcc87HPu-38gxCgHWXr4zFBUrDSn06EpZgzhij6zBAG-6s7mX7FHJJeYdnXe6PGqu0w4Z4hSZDGNWyucOZ6IdWSh921hhHMPgnUorvBKSNStAo0L5r8u37J_fGBxCYaqw=&lang=sage
Sun, 20 Jul 2014 19:58:38 +0200https://ask.sagemath.org/question/23494/solving-implicit-equation/?answer=23505#post-id-23505Comment by mresimulator for <p>One option, and this might be suboptimal, is to replace sin(x) with its taylor series.</p>
<p>Because </p>
<p>sin(x) = x - (1/6)x^3 + (1/120)x^5 - (1/5040)x^7 + (1/362880)x^9 - O(x^11)</p>
<p>we would change</p>
<p>A<em>sin(x) = B</em>C - B*x</p>
<p>into instead</p>
<p>Ax - (A/6)x^3 + (A/120)x^5 - (A/5040)x^7 + (A/362880)x^9 - O(A x^11) = B<em>C - B</em>x</p>
<p>giving you then</p>
<p>-BC + (A+B)x - (A/6)x^3 + (A/120)x^5 - (A/5040)x^7 + (A/362880)x^9 - O(A x^11) = 0</p>
<p>or if you want a few more terms</p>
<p>-BC + (A+B)x - (A/3!)x^3 + (A/5!)x^5 - (A/7!)x^7 + (A/9!)x^9 - (A/11!)x^11 + (A/13!)x^13 + O(A x^15) = 0</p>
<p>This does reveal that varying C will only affect the answer by a constant.</p>
<p>If A and B were fixed constants, known in advance, then you could use "for" and "find_root" to find a
value of x for a long sequence of C values, forming a table of values.</p>
<p>For example:</p>
<p><a href="http://sagecell.sagemath.org/?z=eJxtkEEOgjAQRfck3OEHN61AbCXGaNIFsPcImkZFG6XFWo3eXigukDiLyeT1zUzbp7QkylGgjGgYhEEueBgUXarfu-PtIZ0yGgJpMS0Rg-RxQacvpG01q-TeGavklWS0hdvMCwO88HgxtpceL8f2yuPV2Obcc87HPu-38gxCgHWXr4zFBUrDSn06EpZgzhij6zBAG-6s7mX7FHJJeYdnXe6PGqu0w4Z4hSZDGNWyucOZ6IdWSh921hhHMPgnUorvBKSNStAo0L5r8u37J_fGBxCYaqw=&lang=sage">http://sagecell.sagemath.org/?z=eJxtk...</a></p>
https://ask.sagemath.org/question/23494/solving-implicit-equation/?comment=23506#post-id-23506Thanks. It can't be done wothout using Taylor expansion?Mon, 21 Jul 2014 00:36:54 +0200https://ask.sagemath.org/question/23494/solving-implicit-equation/?comment=23506#post-id-23506Comment by Gregory Bard for <p>One option, and this might be suboptimal, is to replace sin(x) with its taylor series.</p>
<p>Because </p>
<p>sin(x) = x - (1/6)x^3 + (1/120)x^5 - (1/5040)x^7 + (1/362880)x^9 - O(x^11)</p>
<p>we would change</p>
<p>A<em>sin(x) = B</em>C - B*x</p>
<p>into instead</p>
<p>Ax - (A/6)x^3 + (A/120)x^5 - (A/5040)x^7 + (A/362880)x^9 - O(A x^11) = B<em>C - B</em>x</p>
<p>giving you then</p>
<p>-BC + (A+B)x - (A/6)x^3 + (A/120)x^5 - (A/5040)x^7 + (A/362880)x^9 - O(A x^11) = 0</p>
<p>or if you want a few more terms</p>
<p>-BC + (A+B)x - (A/3!)x^3 + (A/5!)x^5 - (A/7!)x^7 + (A/9!)x^9 - (A/11!)x^11 + (A/13!)x^13 + O(A x^15) = 0</p>
<p>This does reveal that varying C will only affect the answer by a constant.</p>
<p>If A and B were fixed constants, known in advance, then you could use "for" and "find_root" to find a
value of x for a long sequence of C values, forming a table of values.</p>
<p>For example:</p>
<p><a href="http://sagecell.sagemath.org/?z=eJxtkEEOgjAQRfck3OEHN61AbCXGaNIFsPcImkZFG6XFWo3eXigukDiLyeT1zUzbp7QkylGgjGgYhEEueBgUXarfu-PtIZ0yGgJpMS0Rg-RxQacvpG01q-TeGavklWS0hdvMCwO88HgxtpceL8f2yuPV2Obcc87HPu-38gxCgHWXr4zFBUrDSn06EpZgzhij6zBAG-6s7mX7FHJJeYdnXe6PGqu0w4Z4hSZDGNWyucOZ6IdWSh921hhHMPgnUorvBKSNStAo0L5r8u37J_fGBxCYaqw=&lang=sage">http://sagecell.sagemath.org/?z=eJxtk...</a></p>
https://ask.sagemath.org/question/23494/solving-implicit-equation/?comment=23518#post-id-23518I'm guessing that you need either the Taylor expansion or some competitor of it, like the Chebychev polynomials. The main issue is that you have both sin x and a linear polynomial in x. Therefore, I really can't see how you would "solve for x." I'm about 98% sure but I don't want to say 100%, because mathematics is always full of surprises.Mon, 21 Jul 2014 19:15:59 +0200https://ask.sagemath.org/question/23494/solving-implicit-equation/?comment=23518#post-id-23518