Tag Info

Hot answers tagged

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


17

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


16

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]:= ...


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

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


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

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.


14

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


14

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


13

Since nobody pointed this out I think there is still room for another reply. Note that this works fine Unevaluated[(x + Log[y*z])/(y*z)] /. (y*z) :> w (x + Log[w])/w In more complex cases you may also need to use HoldPattern Unevaluated[(x + Log[(y*z)/2])/((y*z)/2)] /. HoldPattern[((y*z)/2)] :> w (x + Log[w])/w This is not a panacea. ...


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

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


12

Working with RSolve we can find much more than only a few first terms, here is a general term of your function u[n] e.g. : u[n_] = u[n] /. Flatten[ RSolve[{ u[1] == 1, u[2] == 2, u[3] == 3, u[n] == -u[n-3] + 3 u[n-2] + 2 u[n-1]}, u[n], n]] Root[1 - 3 #1 - 2 #1^2 + #1^3 &, 3]^n Root[-45 + 457 #1 - 1028 #1^2 + 257 ...


11

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


11

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


11

FullSimplify is Simplify with additional transformation rules; some of these rules may be necessary to simplify a polynomial to a form where you can see the equality explicitly. In case of polynomials, I usually use Simplify@Expand to group terms the same way; Expand brings the polynomial in an unambiguous standard form, at which point both results should ...


11

I've always considered the "suitable for symbolic manipuation" line to be a bit of truth wrapped in marketing speak and not meant to mean anything mathematically precise. The documentation center guides and tutorials are good examples of hyperbole in technical documentation (see for instance, the opening lines in Mathematical Typesetting). Coming to the ...


11

There is nothing wrong with the issue in the question. Mathematica shouldn't evaluate Simplify[ Integrate[f[x] + g[x], x] == Integrate[f[x], x] + Integrate[g[x], x]] to True, because in general such a rule would be mathematically simply wrong. Consider e.g. $ \forall_{x } f(x) = - g(x)$, while $f$ is not e.g. Lesbegue integrable. Of course ...


11

Firstly convert the equations to matrix/vector form (i.e. $m_1.x=-m_0$). {m0, m1} = CoefficientArrays[Equations, Unknows] Then compute the (symbolic) solution. soln = LinearSolve[m1, -m0] // Chop[#, 10^-6] & I have chopped parts of the solution that are small, but you don't have to do this. Verify that the solution is correct. m1.soln + m0 // ...


11

This is in fact more of a math question than a Mathematica one. Your equation is one of the many transcendental equations (as opposed to being an algebraic equation that can be solved with methods for solving polynomials) that one cannot solve with the usual ways taught in undergraduate algebra/precalculus courses. In particular, the difficulty in solving ...


10

In Mathematica, the type of a built-in object is represented by the Head. For example, Head[3] is Integer, Head[1.5] is Real and Head[a] is Symbol (assuming that a hasn't been assigned a value, of course, because in that case, you'll get the Head of that value). Note that for expressions of the form foo[bar,baz], the head is foo. Most expressions are ...


10

Searke hints at the answer. Remembering that the dot product is a specific form of Inner: Inner[Times,P,Q,Plus] We can simply replace Times wtih NonCommutativeMultiply Inner[NonCommutativeMultiply, P, Q, Plus] With the output: { {P1 ** Q1 + P12 ** Transpose[Q12],P1 ** Q12 + P12 ** Q2}, {P2 ** Transpose[Q12] + Transpose[P12] ** Q1, P2 ** Q2 + ...


10

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


10

If you need to work with a set of variables symbolically, but you also need to substitute in values for them occasionally, a good approach is to use a rule list: values = {a -> 0.04, L1 = 1, L0 -> 1} If the symbols have no values assigned, you can use them normally in symbolic calculations: L[s_, L0_, L1_, a_] := L1 + L0/(1 + s/a) D[L[s, L0, L1, ...


10

For example, Reduce: Reduce[ ForAll[x, α*x^2 + β*x + γ > 0], {α, β, γ}, Reals ] which looks like this: tells us that $\alpha x^2+\beta x+\gamma>0$ for all $x$ if these conditions hold: Or Resolve: Resolve[ ForAll[x, α*x^2 + β*x + γ > 0] && x ∈ Reals, Reals ]


10

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


9

You should assume that your variables are real, (if you want M to proceed further) because Mathematica treats variables in general as complex. One of many ways to do it : expr = A ((Cos[k y] + I Sin[k y]) 2 I Sin[t ω]); Refine[ Im[ expr], (A | k y | t ω) ∈ Reals] 2 A Cos[k y] Sin[t ω] We needn't use ComplexExpand defining expr, but in this case it ...


9

Define expr[mu_, h_, r_, a_] := ((mu h a)/(1 + h a))^ a ((mu h (1 - a))/((1 + h a) (1 + h)))^(1 - a) + ( r mu h^2 a (2 + h) (1 - a))/((1 + h (1 - a)) (1 + h) (1 + h a)) - ((mu h a)/(1 + h))^a ((mu h (1 - a))/(1 + h))^(1 - a); Then the limits of $\alpha \downarrow 0$ and $\alpha \uparrow 1$ are easy for Mathematica: In[15]:= ...


9

You can use Select to pull the elements meeting some specified criterion from a list. The selected elements are returned in a list that you can feed to Total to sum them. Total is better than Sum for your problem because you don't have to supply the length of the list and you have no need for indexing. Clear[u]; u[1] := 1; u[2] := 2; u[3] := 3; u[y_] := ...


9

Solution using Block The easiest option is probably to use Block, and wrap your result in Hold or HoldForm. So, a = 1; b = 2; c = 3; result = Block[{a, b, c}, Hold[Evaluate[Expand[(a + b + c)^3]]] ] (* Hold[a^3+3 a^2 b+3 a b^2+b^3+3 a^2 c+6 a b c+3 b^2 c+3 a c^2+3 b c^2+c^3] *) The values will be automatically substituted once you call ...



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