Hot answers tagged

36

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. ...


31

You can check out this one. I don't know how well it works Periodic`PeriodicFunctionPeriod[E^(I 2 Pi t) + Cos[3/9 Pi t], t] 6 Perhaps you are also interested in the other functions in that context. Check Names["Periodic`*"] EDIT As @Artes notes in the comments, in v10 there's a documented version of this function called FunctionPeriod


30

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, ...


30

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}, ...


28

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}]}, ...


26

Removing the imaginary portion of an expression is done by doing ComplexExpand[Re[expression]]. Using just Re alone will not work as Re does no evaluation on symbols with unknown complex parts. Now as stated in the problem and the comments above this particular problem requires a fair amount of assumptions. The simplest way to add local assumptions is to ...


21

You can use TrigExpand to expand all trigonometric functions to fundamental forms and then Eliminate solves the rest eq1 = Sin[x]^8 + 2 Cos[x]^8 - 1/2 Cos[2 x]^2 + 4 Sin[x]^2 == 0; eq2 = t == Cos[2 x] Eliminate[TrigExpand[{eq1, eq2}], x]


21

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])


21

I. $\sqrt{z}$ Quick, what's the square root of $4$? If you said $2$, you're right! If you said $-2$, you're right! Wait, what? Solve[x^2 == 4, x] {{x -> -2}, {x -> 2}} A lot of functions have the problem of not having a unique inverse. That is, if you ask what are the possible values an inverse can take, you might end up with two, three, ...


19

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 ...


18

Disclaimer: This is not a full answer, but perhaps it's a start. From an algebraic stand point this seems like a very hard problem. I attacked it with a more brute force approach. I guess a basis and use LatticeReduce to try to find a Diophantine relation. Note this code only tries to identify roots as the product of integral powers of trig. If it returns ...


17

Looking at the Trace of one which does work: x = Sin[Pi/5] (* Sqrt[5/8 - Sqrt[5]/8] *) Trace[ArcSin[x], TraceInternal -> True] It appears that Mathematica computes the ArcSin numerically and then recognises the result, 0.628319 as possibly equal to Pi/5. To check it computes Sin[Pi/5], and subtracts it from the original argument to see if it gets ...


17

Mathematica auto simplifies simple trig expressions like these, but you can turn off this setting via SystemOptions: SetSystemOptions["SimplificationOptions" -> "AutosimplifyTrigs" -> False]; Now we see your change is left untouched without the need of HoldForm and friends. (1 - Tan[x])/(Sin[x] - Cos[x]) /. Tan[x] -> Sin[x]/Cos[x] (1 - ...


16

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 ...


16

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[π/x], x, x] < 0, Assumptions -> x > 1] True This means that the first derivative $f'(x)$ ...


16

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 ...


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:


15

General remarks These are are crucial aspects of solving equations symbolically: So far (in general) Mathematica cannot solve transcendental equations when two unknowns are involved, nevervetheless in some exceptional cases it may seem like it could (see e.g. How do I solve this equation?). This is also the case when some symbolic constants are involved ...


13

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 / ...


13

I have to thank you for leading me down a fascinating rabbit hole! I have always found airfoil shapes enormously pleasing, but I was not aware of the NACA system. For those who, like me, did not know much about the story, NACA was the predecessor of NASA. They established some of the first airfoil definitions codified through mathematical relationships. For ...


12

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 ...


12

In addition to Mr. Wizard's analysis, one can also avoid the indeterminacy by replacing ArcTan as follows: Compile[{}, With[{r = Range[-2, 2, 0.005]}, Table[Arg[Complex[x, y]], {x, r}, {y, r}]]][]; The fact that ArcTan[0,0] is undefined is a real nuisance, and I never saw the point of it because that form of the function is mainly used for ...


12

Removing the double angles (e.g. $\cos(2 \theta) = \cos^2(\theta) - \sin^2(\theta)$) with TrigExpand allows the elimination to be performed: eq = TrigExpand @ { Cos[θ] + Cos[ϕ] + Cos[ψ] == a, Sin[θ] + Sin[ϕ] + Sin[ψ] == b, Cos[2 θ] + Cos[2 ϕ] + Cos[2 ψ] == c, Sin[2 θ] + Sin[2 ϕ] + Sin[2 ψ] == d}; Eliminate[eq, {θ, ϕ, ψ}] $a^4+2 a^2 ...


12

Try TrigExpand TrigExpand[Cos[2 ArcCos[A]]] -1 + 2 A^2


11

Plot[Sin[x], {x, -4 Pi, 4 Pi}, Mesh -> {{0, 2 Pi}}, MeshShading -> {ColorData[1][1], Red}] Update [@belisarius pointed out that another answer shows the built-in, but undocumented, function Period`PeriodicFunctionPeriod that returns the period of a periodic function with exact coefficients.] If you'd like more general functionality, one can ...


11

Here's another way: Assuming[Element[{i, j, k}, Integers], Refine[Cos[(i + j + k) Pi]]]


11

In the course of answering this question, I ran into a little bit of weirdness that doesn't square with my experience with previous versions of Mathematica. I think writing this answer is as good a time as any to bring it up. Firstly, there is this tantalizing line from the internal implementation notes: FunctionExpand uses an extension of Gauss's ...


11

Here's two possibilities: Simplify[TrigExpand[Tan[ArcTan[a] - ArcTan[b]]]] (a - b)/(1 + a b) FullSimplify[Tan[ArcTan[a] - ArcTan[b]], ComplexityFunction -> (LeafCount[#] + 1000 Count[#, ArcTan[_], Infinity] &)] (a - b)/(1 + a b)


10

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, ...


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 ...



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