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, 05 Jul 2020 20:22:18 +0200How do I solve cos(2*t)==sin(t)https://ask.sagemath.org/question/52344/how-do-i-solve-cos2tsint/I tried solving
> solve(cos(2*t)==sin(t),t)
I got
> [cos(2*t) == sin(t)]
But this shouldn't be the value. I know from the graphs that the value is numeric.
I have also noticed that sagemath is not good for solving trig identities. Is this true?loloraSun, 05 Jul 2020 20:22:18 +0200https://ask.sagemath.org/question/52344/Unexpected result for trigonometric functionhttps://ask.sagemath.org/question/51525/unexpected-result-for-trigonometric-function/I'm trying to solve the following trig eqn using sage.
$$sin(x)-cos(x) = 0$$
Hand calculation give me the result of: $$x=\frac{\pi}{4} + n\pi$$
However, the `solve()` function gives me a different result, why is that?:
sage:
sage: solve(sin(x)-cos(x) == 0, x, to_poly_solve=True)
[x == 1/4*pi + pi*z25]
sage:
Also, what's `z` in the answer? I haven't defined any such variable.ggSun, 24 May 2020 03:39:24 +0200https://ask.sagemath.org/question/51525/How to find all roots with solve?https://ask.sagemath.org/question/48808/how-to-find-all-roots-with-solve/I have the following quantity:
c_p = 1 - (4*sin(th)^2+2*5*sin(th)/pi+(5/(2*pi))^2)
and I am trying to find its roots (the solutions for `c_p==0`).
When plotting `c_p` as a function of `th` between $-\pi$ and $\pi$, I can see the curve crosses the x-axis at four positions. However, `solve(c_p==0, th)` is only giving two roots:
$$\left[\theta = -\arcsin\left(\frac{5}{4 \ \pi} + \frac{1}{2}\right),\quad \theta = -\arcsin\left(\frac{5}{4 \ \pi} - \frac{1}{2}\right)\right].$$
It appears that `solve` can only find the roots that are in the domain of the $\arcsin$ function, i.e in the interval $[-\dfrac{\pi}{2},\dfrac{\pi}{2}]$. Is there a way to get the other two roots?TofiTue, 19 Nov 2019 01:27:26 +0100https://ask.sagemath.org/question/48808/evaluate (simplify) trigonometric expressionhttps://ask.sagemath.org/question/41993/evaluate-simplify-trigonometric-expression/
t = var('t')
R = vector ((3*cos(t), 3*sin(t), 4*t))
dRdt = R.diff(t)
show(dRdt)
ds = dRdt.norm()
show(ds)
when I try to show ds it gives mi a trigonometric expression which is actually is equal to 5.
I tried simplify() and trig_simplify but it didn't help...
Any tips are welcome.
Thanks in advancewatty_Thu, 12 Apr 2018 19:13:32 +0200https://ask.sagemath.org/question/41993/How do you find all three angles ?Are there any proof of how to claim all three?https://ask.sagemath.org/question/41011/how-do-you-find-all-three-angles-are-there-any-proof-of-how-to-claim-all-three/
For a triangle of $\angle A B C$ the sides of $ a,b,c$ are written in a way of $a=\frac{\sin A}{\sin C}$, $b=\frac{\sin B}{\sin C}$, $c=\frac{\sin C}{\sin C}$ and the heights $h_a,h_b,h_c$ are written in a form $\frac {h_c}{h_a}=$,$\frac{h_c}{h_b}=$,$\frac{h_c}{h_c}$ to give us $ a$ and $b$. and the base $c=1$.
If I have a triangle with sides $5,5,4 $ and their altitudes are $\sqrt {21},\sqrt {13.44},\sqrt {13.44}$ , why do they simplify to give us a special kind of triangle where $a=1.25,b=1.25,c=1$
>$\sqrt\frac {21}{13.44}=1.25$
Angles
$3=0.16+0.16+0.68^2+0.84+0.84+(1-0.68^2)$
Laws of Cosine ,when we have all $3$ lengths are:
>$a^2=b^2+c^2-2bc\cos(A)$
>$b^2=a^2+c^2-2ac\cos(B)$
>$c^2=a^2+b^2-2ab\cos(C)$
Here we have sides $1.25,1.25 and 1$,a simplest version of the triangle measuring $5,5,4$.
And for three sides of a triangle $a,b,c$,and $\angle ABC$. The legs of the heights $h_a,h_b,h_c$ are situated on three sides of the triangle.
For one side $a$ I have $\frac{b-\cos(A)}{\cos(C)}=a$ and for the second side $b$ I have $\frac{a-\cos(B)}{\cos(C)}=b$ and the third side which is $c$ as the base of the triangle equals to $1$.
>$\sqrt{\sin^2(B)+(a-\cos(B))^2}=b$
>$\sqrt{\sin^2(A)+(b-\cos(A))^2}=a$
>$\sqrt{\sin^2(A)+(\cos(A))^2}=c$
>by using consecutive or non consecutive numbers:
>$a<b<c $ we're able to define $\theta$ without conversion
>$\frac{a}{c}=\cos(C)$ $(1-\frac{a}{c})\times\sqrt\frac{(a+c)}{(c-a)}=\sin(C)$
>$\sqrt\frac{(c-b)}{c}=\cos(B)$ $\sqrt\frac{b}{c}=\sin(B)$
Find
>$\cos(A)$ & $\sin(A)$ which we already know.
> Question is: why $\frac{h_c}{h_b}$; $\frac{h_c}{h_a}$;$\frac{h_c}{h_c}$ and. $\frac{\sin A}{\sin C}$; $\frac{\sin B}{\sin C}$ $\frac{\sin C}{\sin C}$equal to the sides $a,b,c$?LarrousseWed, 07 Feb 2018 15:45:18 +0100https://ask.sagemath.org/question/41011/How to simplify 1-cos(u)^2.https://ask.sagemath.org/question/38039/how-to-simplify-1-cosu2/ I have tried
sage: assume(0<u<pi/2)
But I still get
sage: simplify(1-cos(u)^2)
-cos(u)^2 + 1
ablmfWed, 21 Jun 2017 09:36:32 +0200https://ask.sagemath.org/question/38039/How to get sage to simplify sin(pi/16)?https://ask.sagemath.org/question/36919/how-to-get-sage-to-simplify-sinpi16/I'm trying to look at numbers of the form sin(pi/2^n), but when I ask for a list of the first 10, I get [0,1, 1/2*sqrt(2), 1/2*sqrt(-sqrt(2) + 2), sin(1/16*pi), sin(1/32*pi)...]
Why are these not being reduced, even when I call sin(1/16*pi).simplify_full()? How can I make sage simplify them?Shamrock-FrostSun, 12 Mar 2017 06:00:03 +0100https://ask.sagemath.org/question/36919/Solving a trigonometric equationhttps://ask.sagemath.org/question/34449/solving-a-trigonometric-equation/ How to solve a trigonometric equation like
2*(1-sin(x)) == 1-cos(x)
I've tried all possible commands in sage, I couldn't obtain any value while the geogebra's algebra system solves it very well for instance. Yet I don't think sage is less powerful than geogebra to solve equations...
Thx for answers.Romuald_314Fri, 12 Aug 2016 19:48:56 +0200https://ask.sagemath.org/question/34449/Graph x sin 0 to 720https://ask.sagemath.org/question/33583/graph-x-sin-0-to-720/We will now draw a graph of sin x from 0 to 720.
Enter the command to do this in Sage.
What command was used?
I'm assuming its something like
plot sin(x*pi/180) for 0<x<720
Usually i'd keep searching until i figure it out myself but i'm really behind on study and don't have the time.
If i could just get the code that would be great!
Many thanks.ZantheorMon, 30 May 2016 13:07:04 +0200https://ask.sagemath.org/question/33583/Sage fails to evaluate this expression.https://ask.sagemath.org/question/26372/sage-fails-to-evaluate-this-expression/Sage doesn't seem to compute correctly `8*sin(pi/9)^3 - 6*sin(pi/9) + 3^(1/2)` which is plain zero.xiver77Sun, 29 Mar 2015 11:12:06 +0200https://ask.sagemath.org/question/26372/Simplify produces an incorrect result.https://ask.sagemath.org/question/11055/simplify-produces-an-incorrect-result/I am using sagemath.com for this test on 19 Feb 2014. I applied Simplify to
C = ((((K - 1)*L*sin(-(K - 1)*t/K) + (K - 1)) *
((K - 1)^2*L*sin(-(K - 1)*t/K)/K + (K - 1)*sin(t))) -
((K - 1)*L*cos(-(K - 1)*t/K) - (K - 1)*cos(t)) *
(-(K - 1)^2*L*cos(-(K - 1)*t/K)/K + (K - 1)*cos(t)))
/ ((((K - 1)*L*sin(-(K - 1)*t/K) + (K - 1)*sin(t))^2 +
((K - 1)*L*cos(-(K - 1)*t/K) - (K - 1)*cos(t))^2)^(3/2))
The result returned is about 10 times too small and the peaks shift position as K is increased toward 1. K and L are parameters that should be within (0,1). Plot with K = 0.42 and L = 0.22 in Sagemath demonstrates the problem.
Cs = ((K - 1)*L*cos((K - 1)*t/K) - (K - 1)*cos(t)) *
((K - 1)^2*L*cos((K - 1)*t/K)/K - (K - 1)*cos(t)) +
((K - 1)*L*sin((K - 1)*t/K) - K + 1) *
((K - 1)^2*L*sin((K - 1)*t/K)/K - (K - 1)*sin(t))
As K approaches 0, the results more closely agree. Is this possibly a roundoff problem because of the numerator in C?
I verified the difference between the two using both Sagemath.com plot and Geogebra.
jcfriedWed, 19 Feb 2014 20:39:21 +0100https://ask.sagemath.org/question/11055/Calculus graphing. Urgent help appreciated!https://ask.sagemath.org/question/10132/calculus-graphing-urgent-help-appreciated/A math student writes a proof of the derivative of a certain trigonometric function. The last line she writes before stating her conclusion is...
**d/d?(sin(?+?/2))=cos(?+?/2)**
These are the graphs of sin(?+?/2) and cos(?+?/2)
**sin(?+?/2)** = http://www.wolframalpha.com/input/?i=sin%28theta%2Bpi%2F2%29&lk=4
**cos(?+?/2)**= http://www.wolframalpha.com/input/?i=cos%28theta%2Bpi%2F2%29&lk=4&num=1
Hence, write the statement of her conclusion beginning with the word, "Therefore...".ArielaSat, 18 May 2013 04:41:43 +0200https://ask.sagemath.org/question/10132/Sage cannot simplify arccos, but can simplify arcsin?https://ask.sagemath.org/question/10044/sage-cannot-simplify-arccos-but-can-simplify-arcsin/I am using Sage 5.7. It can simplify expressions involving arcsin, but not arccos, why?
Thanks
<pre>
assume(x > 0)
assume(x < pi/2)
acos(cos(x)).simplify_full()
output: arccos(cos(x))
asin(sin(x)).simplify_full()
output: x
</pre>sgiaSat, 20 Apr 2013 18:07:12 +0200https://ask.sagemath.org/question/10044/arctan(cot(2pi/3))https://ask.sagemath.org/question/9960/arctancot2pi3/find an exact value for arctan(cot 2pi/3)AdamSat, 30 Mar 2013 13:54:38 +0100https://ask.sagemath.org/question/9960/Trigonometric Equation Solving: Not Terminatinghttps://ask.sagemath.org/question/9898/trigonometric-equation-solving-not-terminating/## The Background
I want to write a script which is able to do the following:
- **INPUT:** **`x`** - A list of triangle items. These items are considered as given.
- **INPUT:** **`y`** - A list of triangle items. We want to know the abstract formulas of these items.
- **OUTPUT:** **`z`** - A list of formulas to calculate the items from `y`
For example:
- **INPUT:** **`x`** - `[alpha, beta]` (considered as given)
- **INPUT:** **`y`** - `[gamma]` (we want to know the formula of `gamma`)
- **OUTPUT:** **`z`** - `[gamma == pi - alpha - beta]`
I want to do that using `sage`'s `solve()`.
## My Problem:
This is a simplified script. It is just able to output formulas for `alpha`, `beta` and `gamma` when `a`, `b` and `c` are considered as given:
rings = RR[('a', 'b', 'c')].gens()[:3] # considered as given
x = dict([(str(rings_), rings_) for rings_ in rings])
varbs = SR.var(['alpha', 'beta', 'gamma']) # looking for `alpha`, `beta` and `gamma`
x.update([(str(varbs_), varbs_) for varbs_ in varbs])
print solve([
#x['a']**2 == x['b']**2 + x['c']**2 - 2*x['b']*x['c']*cos(x['alpha']),
#x['b']**2 == x['a']**2 + x['c']**2 - 2*x['a']*x['c']*cos(x['beta']),
#x['c']**2 == x['a']**2 + x['b']**2 - 2*x['a']*x['b']*cos(x['gamma']),
x['alpha'] == arccos((x['a']**2 - x['b']**2 - x['c']**2) / 2*x['b']*x['c']),
x['beta'] == arccos((x['b']**2 - x['a']**2 - x['c']**2) / 2*x['a']*x['c']),
x['gamma'] == arccos((x['c']**2 - x['a']**2 - x['b']**2) / 2*x['a']*x['b']),
#pi == x['alpha'] + x['beta'] + x['gamma'],
], [
x['alpha'],
x['beta'],
x['gamma'],
])
This script is working correctly and outputs:
[
[alpha == pi - arccos(-0.5*a^2*b*c + 0.5*b^3*c + 0.5*b*c^3), beta == pi - arccos(0.5*a^3*c - 0.5*a*b^2*c + 0.5*a*c^3), gamma == arccos(-0.5*a^3*b - 0.5*a*b^3 + 0.5*a*b*c^2)]
]
I wanted to extend `solve()`'s knowledge base in order to be able to solve more complicated problems later on. But when I tried to uncomment the `#` lines and ran the script again, `solve()` didn't terminate any more.
## My Question:
* Why doesn't `solve()` terminate when I uncomment the `#` lines?
* How can I get `sage` to terminate? Or: How can I work around this problem?
Thanks - if anything's unclear, please leave a comment concerning that.fdj815Sun, 10 Mar 2013 09:56:09 +0100https://ask.sagemath.org/question/9898/odd trig function behaviorhttps://ask.sagemath.org/question/9403/odd-trig-function-behavior/I get different behavior for trig functions at poles depending on how I evaluate them. For example:
f(x)=tan(x)^2-tan(x)
f(pi/2)
gives `0`, which is disturbing.
Yet
f(x)=tan(x)*(tan(x)-1)
f(pi/2)
gives `Infinity`.
And,
tan(pi/2)^2-tan(pi/2)
gives
`Infinity`.
What's going on here?
calc314Mon, 08 Oct 2012 14:35:55 +0200https://ask.sagemath.org/question/9403/