Tag Info

Hot answers tagged

33

I guess that V9 now adds this capability: $Assumptions = { Element[A, Matrices[{m, n}]], Element[B, Matrices[{n, k}]] }; TensorReduce[ Transpose[Transpose[A].Transpose[B]] ] (* Out: B.A *)


32

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


23

You can't use replacements that way, because Mathematica does not do replacements on expressions the way they appear to you. To see what I mean, take a look at the FullForm of your expression: x/(y*z) // FullForm Out[1]= Times[x,Power[y,-1],Power[z,-1]] Whereas, the replacement that you're using is Times[y, z]. In general, it is not a good idea to use ...


21

Mathematica does not support this directly. You can do things of this sort using an external package called NCAlgebra. http://math.ucsd.edu/~ncalg/ The relevant documentation may be found at http://math.ucsd.edu/~ncalg/DOWNLOAD2010/DOCUMENTATION/html/NCBIGDOCch4.html#x8-510004.4 In particular have a look at "4.4.8 NCLDUDecomposition[aMatrix, Options]" ...


20

The most direct way to test this is probably the following: $Assumptions = x > 0; Element[x, Reals] // Simplify (* Out[1]= True *) $Assumptions = True; Element[x, Reals] // Simplify (* Out[4]= x ∈ Reals *) So $x>0$ seems to imply that $x$ is real.


20

A first step would be to implement a convenience function that can automatically apply the method of separation of variables to separable types of equations. To show that the steps could in principle be automated, let me repeat basically the same calculation that I did for cylindrical coordinates with only slight modifications to the heat equation: ...


19

One way is to use an extra argument that acts as a switch. Clear[f]; f[0] = 1; f[1] = 1; f[n_, True] := f[n - 1] + f[n - 2] Example: f7 = f[7, True] (* Out[329]= f[5] + f[6] *) To proceed another step, can do a replacement. f7 /. f[aa_] :> f[aa, True] (* Out[330]= f[3] + 2 f[4] + f[5] *) Can use Nest to repeat this n times. Nest[# /. f[aa_] ...


19

Usage: dChange[expresion, {transformations}, {oldVars}, {newVars}, {functions}] You can also skip {} if a list has only one element. (Update) Examples: 0. wave equation in retarded/advanced coordinates dChange[ D[u[x, t], {t, 2}] == c^2 D[u[x, t], {x, 2}], {a == x + c t, r == x - c t}, {x, t}, {a, r}, {u[x, t]} ] c Derivative[1, 1][u][a, r] == ...


18

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


18

What you have is a MultinormalDistribution. The quadratic and linear forms in the exponential can be rewritten in terms of $\frac12(\vec{x}-\vec{\mu})^\top\Sigma^{-1}(\vec{x}-\vec{\mu})$ where $\vec{\mu}$ represents the mean and $\Sigma$ the covariance matrix, see the documentation. With this, you can do integrals of the type given in the question by ...


18

After all this time I came up with a very nice tensor calculus proof of the Hairy Ball Theorem. It only depends on Stokes theorem and standard laws of tensor calculus like the Ricci identity and symmetries of curvature tensors. All the topology is done by Stokes theorem. The remainder of the proof is equational, local and geometrical. It is coordinate/basis ...


17

It is assumed that $x$ is a real number. Everything else would mathematically not make sense because on complex numbers there does not exist an ordering relation. An example would be to take the expression $\sqrt{x^2}$ and to imagine that this is not equal $x$ for $x=-\mathbb{i}$. Therefore the expression is in a general form not simplified In[37]:= ...


17

There is no need to play around with ReplaceAll, Rule, Block, Module or whatever using D, since you have an oparator Derivative really fulfilling your needs while you need not bother if the arguments were defined, so I recommend it to find symbolic derivatives of your function. Remember of shorthands f', f'' to represent first and second derivatives of ...


17

The nearest Mathematica has to "types" are Heads of expressions that are Atoms. For example: Through[{AtomQ, Head}[2]] {True, Integer} Through[{AtomQ, Head}[2 + I]] {True, Complex} Through[{AtomQ, Head}["cat"]] {True, String} and so on... There are also somewhat different "types" in the context of Compile.


17

In this case you can use SeriesCoefficient SeriesCoefficient[Exp[x], {x, 0, n}]


16

If you use the third argument in Solve, i.e. a list of variables to be eliminated (take a look at the Eliminating Variables tutorial in Mathematica) then you'll get the result immediately : Solve[{a b c == -1, a^2/c + b/c^2 == 1, a^2 b + b^2 c + c^2 a == t, a b^5 + b c^5 + c a^5 == res}, {res}, {a, b, c, t}] {{res -> 3}} Edit ...


16

Short story $$ \vartheta(x) = \arg \left[(\operatorname{Bi}x+i \operatorname{Ai}x)e^{-\frac{2}{3} i (-x)^{3/2}}\right]+\frac{2}{3} \operatorname{Re}\left[(-x)^{3/2}\right] $$ Update: I see that you want use only real functions, so you can expand this as $$ \vartheta(x) = \begin{cases} \arctan\frac{\cos \left(\frac{2}{3} (-x)^{3/2}\right) ...


16

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


15

Because the assumption system is not called during the standard evaluation sequence, it is only called when Simplify, FullSimplify, Sum, Integrate etc... are used. Thus, x>0 remains unevaluated: Assuming[x > 0, x > 0] (* ==> x > 0 *) and TrueQ then returns False: Assuming[x > 0, TrueQ[x > 0]] (* ==> False *) If, however, you ...


15

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

Regarding your general question: from my own experience, a large part of my research findings while still at academia would have been much harder or outright impossible to get without Mathematica, and that applies to both numerical and analytical work. I also know this for many other people. There are a number of areas where it allows you to get through some ...


15

Here is extensions to @Jens answer (I think) also relying on possible separation of variable. I is not meant as an independent answer, but complements it. First extend his answer to 2D ClearAll[pt, px, x, t, p]; operator = Function[p, D[p, t] - Δ D[p, x, x] - Δ D[p, y, y]]; ansatz = pt[t] px[x] py[y]; pde2 = Expand[Apply[Subtract, ...


15

Having experienced similar problematic issues with Mathematica I instantly thought that expanding the fraction in the integrand i.e. applying Appart could resolve the problem, and indeed it does: Integrate[ Apart[(1 - x)(1 + 2x)^6/Sqrt[1 - x^2]], {x, -1, 1}]/Pi 15 These arguments apply to this case as well Bug in mathematica analytic integration? i.e. ...


14

An experimental internal function Integrate`InverseIntegrate helps here, although it's intended more for integrands involving logs. This is what it returns in the development version: Integrate`InverseIntegrate[Exp[-x Cosh[t]], {t, 0, Infinity}, Assumptions -> Re[x] > 0] (* BesselK[0, x] *)


14

You are assuming that $$ \sqrt{\frac{a}{b}} = \frac{\sqrt{a}}{\sqrt{b}} $$ This is not generally true. Take for example $a=1$ and $b=-1$ for which this identity does not hold. You need to give additional assumptions to Simplify, in this case that $b>0$. Simplify[Sqrt[a/b] == Sqrt[a]/Sqrt[b], b > 0] (* ==> True *)


14

While the answer of Szabolcs is clearly the best alternative, if you have already assigned values to the variables and clearing them for some reason is no viable option, you can use Block[{s, L0, L1, a}, Hold@Evaluate@D[L[s, L0, L1, a], s]] Unlike Module, Block doesn't introduce new variable names but temporarily removes the values of those given. Hold ...


14

In general, one cannot get explicit analytic solutions of trancendental equations in terms of radicals. This is also the case of univariate higher order polynomial equations. On the other hand since Mathematica 7 we can find exact solutions (in terms of Root objects) of a wide range of (univariate) trancendental equations, for more detailed discussion of ...


14

Here's the exact answer: i1 = Integrate[x^n Exp[-(x - a)^2], {x, 0, Infinity}, Assumptions -> n > 0] /. n -> 1/2 (* 1/2 E^-a^2 (Gamma[3/4] Hypergeometric1F1[3/4, 1/2, a^2] + 1/2 a Gamma[1/4] Hypergeometric1F1[5/4, 3/2, a^2]) *) i1 /. a -> 0.3 (* 0.907605 *)


13

Initially, Mathematica is not designed for such abstract calculations. But, Mathematica is a powerful programming language, so that one can add such functionality easily. See the following examples in related area of differential geometry: calculations in symbolic dimensions Abstract calculations



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