Tag Info

Hot answers tagged

24

There are a couple tricky points here. Here's a start, which I imagine you can finish. markings[t_] := Module[{o={0,0},p={Cos[t],Sin[t]}, t2=Together[t],tFormat, rot}, tFormat = If[Denominator[t2]=!=1, Row[{Numerator[t2],"/",Denominator[t2]}]]; rot = If[TrueQ[Pi/2<Mod[t,2Pi]<3Pi/2],t+Pi,t]; {{Opacity[0.3],Line[{o,p}]}, ...


22

Here's a dynamic version (sorry, I couldn't resist). Manipulate[ DynamicModule[{alist, pt, pc}, pt[a_] := {Cos[a], Sin[a]}; alist = Union[Range[0, 2 Pi - Pi/6, Pi/6], Range[0, 2 Pi - Pi/4, Pi/4]]; a = Nearest[alist, Mod[ArcTan @@ p, 2 Pi, 0]][[1]]; pc = pt[a]; Graphics[{ Circle[], {LightGray, Line[{{0, 0}, pt[#]}] & /@ alist}, ...


21

Solutions to algebraic or transcendental equations are expressed in terms of Root objects whenever it is impossible to find explicit solutions. In general there is no way express roots of 5-th (or higher) order polynomials in terms of radicals. However even higher order algebraic equations can be solved explicitly if an associated Galois group is solvable. ...


15

The function you want for this kind of case is TrigReduce: TrigReduce[expr] rewrites products and powers of trigonometric functions in expr in terms of trigonometric functions with combined arguments. And it works:


14

This is a new version of my answer in response to the edited question (the first version is here). It is based on the same idea, but the Weierstrass substitution rules are now generated by Mathematica (instead of entered by hand) and results with $\pm$ solutions are correctly returned. First, generate the Weierstrass substitution rules $TrigFns = {Sin, ...


13

Try using FullSimplify: FullSimplify[Sin[x] == Tan[x] Cos[x]] This returns True if Sin[x] == Tan[x] Cos[x] (which it does). Please note that == (Equal) should be used instead of a single equal sign (Set). More complicated trig identities can be difficult to reason about. Mathematica may not be able to properly determine whether they are true or not. You ...


13

Here is a numeric approximation method that can be useful when no analytic information is known. I will illustrate with the function WeierstrassPPrime[t, {2, 3}] that was mentioned in a comment to one response. We begin by taking random steps, and sampling the function at those steps (I'll explain the random step size presently). We then plot the ...


13

Use the following representation of the Legendre polynomials: $$ P_n(x) = 2^n \sum_{k=0}^n x^k \binom{n}{k} \binom{\frac{n+k-1}{n}}{n} $$ Note that the sum effectively is over $k \equiv n \bmod 2$. Expand each Legendre polynomial into a sum. Integration with respect to $\theta$ is easy: $$ \int_0^{\pi} \sin^{k_1+k_2+k_3+1} \theta \mathrm{d}\theta ...


12

The proof of the original statement that $f(x)\equiv x\sin\frac{\pi}{x}$ is a monotonically increasing function of $x$ for $x>1$ can be done as follows: First, we show that the second derivative $f''(x)$ of the function is negative: Simplify[D[x Sin[\[Pi]/x], x, x] < 0, Assumptions -> x > 1] True This means that the first ...


11

Mathematica often responds well when provided a little expert assistance. Let's focus on techniques that have a wide application rather than just to this problem. Can the function be decomposed into simpler pieces? Yes, obviously: $f(x)$ is the product of $x$ and $\sin{\pi / x}$. Both are obviously increasing for $x \in [1,2]$. After that, $\sin{\pi / ...


11

One way to do this is: Sin[x]^8 + 2 Cos[x]^8 - 1/2 Cos[2 x]^2 + 4 Sin[x]^2 == 0 /. Solve[t == Cos[2 x], x] //FullSimplify // Expand // Union // Column // TraditionalForm It gives exactly your answer if you get rid of your denominator 16 (multiply both sides of your equation by 16). This will also work with more complex substitutions (for example t ...


10

One way to induce Mathematica to simplify to Tan functions is to introduce the arguments as inverse tangents, as in $x\equiv \arctan a$ and $y\equiv \arctan b$. Then you could write for example Simplify[ TrigExpand@Tan[ArcTan[a] + ArcTan[b]]] /. {a -> Tan[x], b -> Tan[y]} (* ==> (Tan[x] + Tan[y])/(1 - Tan[x] Tan[y]) *) or more generally with ...


9

A bit different approach : Simplify @ TrigReduce[ Sin[x]^8 + 2 Cos[x]^8 - 1/2 Cos[2 x]^2 + 4 Sin[x]^2 == 0 /. Solve[ t == Cos[2 x], x, InverseFunctions -> True][[1]]] 35 + 10 t^2 + 4 t^3 + 3 t^4 == 28 t or using Eliminate : Eliminate[ TrigToExp[{ Sin[x]^8 + 2 Cos[x]^8 - 1/2 Cos[2 x]^2 + 4 Sin[x]^2 == 0, t == Cos[2 x]}], x, ...


9

This is similar to my Log question and similar methods can be used. $PrePrint = # /. { Csc[z_] :> 1 / Defer@Sin[z], Sec[z_] :> 1 / Defer@Cos[z] } &; Example: (x + y) Csc[x] Sec[y] (x + y)/(Cos[y] Sin[x])


8

Short answer: no, ArcTan[2] is not fraction of $\pi$. But this is more of a mathematics question than pertaining to Mathematica. If you want to “check” that the result is not expressable as a fraction of $\pi$, you can check for the continued fraction reprentation of $\arctan(2)/\pi$, and see that it does not seem to converge: ...


8

Maybe this HoldForm[Pi] (1/Pi ArcTan@2.) or if you want a nicer way Rationalize /@ (HoldForm[Pi] N@(1/Pi ArcTan@Range[5])) Edit The latter method works well in cases when there is a rational fraction of $\pi$ : Rationalize /@ (HoldForm[Pi] N @ (1/Pi ArcTan @ { Sqrt[1 - 2/Sqrt[5]], 2 - Sqrt[3], ...


7

Expand doesn't work as you'd like even with Trig -> True. TrigReduce yields the experssion a bit different than expected. Instead, you can use Apart with the option Trig therein (by default Options[Apart, Trig] yields {Trig -> False}) to get exactly the expected output, e.g. : Apart[ Cos[x]^3 Sin[x]^2, Trig -> True] Cos[x]/8 - 1/16 Cos[3 x] - ...


7

There is no best general way to check if any two trigonometric expressions are equal. One can use TrigReduce, TrigExpand, TrigFactor, TrigToExp, Together and Apart (especially with the Trig->True option), Simplify, FullSimplify, etc. All these functions have their advantages and we discuss some of them. For more complicated examples when using Simplify ...


6

I'll answer with a more general module I've done for converting trig expressions. An overkill here, but anyway: trigSet[exp_, inTerm_] := Module[{trigSyms, rels, set, setRep, setRep1, toLow, oneInTermsOf, allInTermsOf, fq, ruleAll, convert}, trigSyms = {Sin, Cos, Tan, Cot, Sec, Csc}; rels = {csc sin == 1, cos^2 + sin^2 == 1, 1 == cos ...


6

If you expand your expression in terms of elementary trig functions Integrate[Cos[x]^5, x] // TrigExpand (5 Sin[x])/8 + 5/16 Cos[x]^2 Sin[x] + 1/16 Cos[x]^4 Sin[x] - ( 5 Sin[x]^3)/48 - 1/8 Cos[x]^2 Sin[x]^3 + Sin[x]^5/80 you will see only even powers of Cos - so it's straightforward to replace it like this: (Integrate[Cos[x]^5, x] // TrigExpand) /. ...


6

You may use this function I wrote for transforming more general trig expressions: trigSet[exp_, inTerm_] := Module[{trigSyms, rels, set, setRep, setRep1, toLow, oneInTermsOf, allInTermsOf, fq, ruleAll, convert}, trigSyms = {Sin, Cos, Tan, Cot, Sec, Csc}; rels = {csc sin == 1, cos^2 + sin^2 ...


6

Here's something I've used before: rotCircle[angle_, ctr_, base1_, base2_, directives___] := With[{step = 0.05 Sign[angle], spiral = 0.01}, {directives, Arrow[Table[ctr + (1.1 + spiral s) (Cos[s] base1 + Sin[s] base2), {s, Append[Range[0, angle, step], angle]}]]} ] Graphics[rotCircle[10., {0, 0}, {1, 0}, {0, 1}, Red, Thick], PlotRange -> ...


5

Simplify (and FullSimplify) gives you the result you want: Simplify[Cosh[I x]] (* Cos[x] *) TrigReduce is another helpful function to remember when working with trigonometric functions. TrigReduce[expr] rewrites products and powers of trigonometric functions in expr in terms of trigonometric functions with combined arguments. TrigReduce[Cosh[I x]] ...


5

If you're after a symbolic solution you might try taking the Cos of both sides : Solve[ Cos[ γ] == TrigExpand[ Cos[ ArcCos[ Cos[α] Sec[θ] ] + ArcCos[ Cos[β] Sec[θ]] ]], θ, Reals] or Reduce[ Cos[γ] == TrigExpand[ Cos[ ArcCos[ Cos[α] Sec[θ] ] + ArcCos[ Cos[β] Sec[θ]]] ], θ, Reals]


4

It's somewhat convenient to use Chebyshev polynomials for such purposes. Here, I use the Chebyshev polynomial of the second kind, due to the convenient identity $$U_n(\cos\,x)=\frac{\sin((n+1)x)}{\sin\,x}$$ Here goes: Integrate[Cos[x]^5, x] /. Sin[n_Integer x] :> Sin[x] ChebyshevU[n - 1, Sqrt[1 - Sin[x]^2]] // Expand Sin[x] - (2 Sin[x]^3)/3 + ...


4

Just playing tricks: Cases[Join @@ Solve[{csc == 1/sin, sec == 1/cos, cos cos + sin sin == 1}, {csc, sin, cos}], HoldPattern[csc -> _]] (* ->{csc -> -(sec/Sqrt[-1 + sec^2]), csc -> sec/Sqrt[-1 + sec^2]} *) Edit More generally (by using @J.M's suggestion below): trigExpress[expr_, inTerms_] := Module[ {set = {sin, cos, tan, sec, ...


4

When you write ArcTan[0,0], you tell Mathematica that the parameters x and y in ArcTan[x,y] are the exact integer 0. As we know, 0/0 cannot be unambiguously defined, and Indeterminate is returned. So ArcTan[0,0] returns the result of Interval[{-Pi,Pi}], for the codomain of ArcTan[0,0] is just between -Pi and Pi. On the other hand, if you write ...


4

Use PossibleZeroQ expr1 = -1/15 Cos[4 x] + (1/15 + 6) Cos[x] + 11 Sin[x]; expr2 = 1/30 (182 Cos[x] - 5 Cos[x] Cos[3 x] + 3 Cos[x] Cos[5 x] + 330 Sin[x] + 5 Sin[x] Sin[3 x] + 3 Sin[x] Sin[5 x]); PossibleZeroQ[expr1 - expr2] (* Out= True *) Use Mathematica's InputForm for showing examples. Wastes much less time for others who later work with ...


4

Just for fun, here is another approach (that I would use intuitively, if I didn't know the other functions existed): expr1 = -1 + 50 Cos[x]^2 - 400 Cos[x]^4 + 1120 Cos[x]^6 - 1280 Cos[x]^8; expr2 = -512 Cos[x]^10 + Cos[10 x]; Integrate[(expr1 - expr2)^2, {x, -\[Infinity], \[Infinity]}] (* 0 *)


3

I have no rigorous training in mathematics - I'm not quite sure what constitutes a proof and what doesn't. How can I properly use Mathematica to prove some theorems like this one? Well, what you can do is use Mathematica to help visualise the function as well as computing derivatives, integrals or limits. My approach is a bit hacky :) The function Okay, ...



Only top voted, non community-wiki answers of a minimum length are eligible