Tag Info

Hot answers tagged

15

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


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

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


13

The code for the default ComplexityFunction was posted on MathSource a number of years ago by Adam Strzebonski (of Wolfram Research). You will see reference to the original reply from Adam referenced in a MathGroup reply from Andrzej Kozlowski dated 12 Jan 2010 with the subject: "[mg106386] Re : Radicals simplify". I mention all that because I can't get the ...


13

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


12

I could be perceived as biased since I'm the CTO of Evolved Analytics (www.evolved-analytics.com) and wrote much of the DataModeler code over the past 13 years, however, DM is probably the most efficient, complete and powerful symbolic regression platform out there for any environment. In addition to the basic model development, it supports the entire ...


12

Working with such a sophisticated function as Reduce, if we can't get the result initially we should add possibly many assumptions. Without the Backsubstitution option it yielded: Reduce[ Abs[x] + Abs[y] + Abs[z] + Abs[t] == 1 && t != 0, {x, y, z, t}, Reals] No more memory available. Mathematica kernel has shut down. Try quitting other ...


11

Since you're working with vectors, just let Mathematica know that these are vectors. Some other systems (MATLAB and its relatives in particular) have the limitation that they can only work with matrices, forcing you to distinguish between row vector and column vectors and keep transposing. This is not necessary nor convenient in Mathematica. In[1]:= ...


10

First, you can try to apply the FunctionExpand command to the DifferenceRoot object. If it is able to find a closed form of the sequence, then the Limit might be able to find an exact symbolic limit. To find a numerical approximation, you can use the SequenceLimit command. In general, it does not guarantee to give the correct result, but if your sequence ...


10

In this particular case Mathematica for some reason considers b[i] as a constant. Compare: Integrate[Exp[Sum[-((cw λ - b)^2/(2 σ^2)), {i, 1, n}]], {cw, 0, 1}] (Sqrt[π/2] σ (Erf[(b Sqrt[n])/(Sqrt[2] σ)]-Erf[(Sqrt[n] (b-λ))/(Sqrt[2] σ)]))/(Sqrt[n] λ) A possible workaround consists in the manually expanding the sum Integrate[Exp[(-n cw^2 λ^2 + 2 cw λ ...


10

FindSequenceFunction and FindGeneratingFunction will attempt to identify how the list was produced. FindSequenceFunction[{1, 1, 2, 3, 5, 8, 13, 21, 34, 55}, n] Fibonacci[n] FindSequenceFunction[{0, 1, 1, 2, 3, 5, 8, 13}, n] FindGeneratingFunction[{0, 0, 1, 2, 3, 5, 8, 13}, n]


10

This does not completely answer the question, but you can get some useful information from the undocumented option IntegrationMonitor. For example: NIntegrate[Sin[Sqrt[x]], {x, 0, 1}, IntegrationMonitor -> Print] You can see (in the Experimental`NumericalFunction) that the change of variables $\sqrt{x}\to x$ has been used to convert the integrand to ...


9

You can use Defer to see how to properly enter your "summation" type notation. Defer[1 + Sum[Sum[1/((k + 2) k!), {k, n, Infinity}], {n, 0, Infinity}]] You can then enter that output to see that it works. You must've entered something different.


9

FullSimplify[(-1)^n*BesselJ[n, z] - BesselJ[-n, z], n ∈ Integers, ComplexityFunction -> (StringLength @ ToString @ # &)] Also: ComplexityFunction -> (Count[#, _BesselJ | _Power, {-2}] &) ComplexityFunction -> (Count[#, _?NumberQ, Infinity] &)


9

You need to specify assumptions: In[1]:= FunctionExpand[StirlingS2[n, 10], n > 0 && Mod[n, 1] == 0] Out[1]= -(1/362880) + 2^(-8 + n)/315 + 1/135 2^(-7 + 2 n) + 1/315 2^(-8 + 3 n) - 3^(-3 + n)/1120 + 1/5 2^(-7 + n) 3^(-3 + n) - 5^(-2 + n)/576 + 1/567 2^(-8 + n) 5^(-2 + n) - 7^(-1 + n)/4320 - 9^(-2 + n)/4480


8

The * multiplication operator is rendered in InputForm: c = a*b; c // InputForm a*b For producing/exporting strings: ExportString[c, "Text"] ToString[c, InputForm] "a*b" "a*b"


7

Here's another way to proceed, using Derivative[], and sidestepping the use of a dummy variable: LogDerivative[f_] := Derivative[1][Composition[Log, f]] Test: LogDerivative[Sin][x] Cot[x] LogDerivative[Gamma][x] PolyGamma[0, x] LogDerivative[#^3 &][x] 3/x


7

I'll start by saying that I don't have an answer, but I found this interesting and wanted to share some of the manipulations I noticed. I'm essentially "thinking out loud". Perhaps in recasting the question, somebody else will notice something. The following is a mixture of manipulations made by hand and some simplifications done in Mathematica. I started ...


7

This issue reminds many similar problems with Integrate. We have in Mathematica 8.0.4: Integrate[ ArcTan[x]/(1 + x) Log[(1 + x^2)/2], {x, -1, 1}] Pi^3/96 However in Mathematica 9.0.1 it takes quite a long time yielding a different result: Integrate[ ArcTan[x]/(1 + x) Log[(1 + x^2)/2], {x, -1, 1}] Infinity This is a bug, we can compare it with ...


7

[This answer was made while the OP question kept being changed...I hope it is current.] The easy way is to use the built-in SymmetricPolynomial: vietePoly[deg_Integer, n_Integer, var_: \[FormalX]] := SymmetricPolynomial[deg, Array[var, n]] Clear[x]; vietePoly[2, 4, x] (* x[1] x[2] + x[1] x[3] + x[2] x[3] + x[1] x[4] + x[2] x[4] + x[3] x[4] *) The ...


7

In cases like this, a little help to Mathematica can often go a long way. You can notice that for these functions, the integral is zero unless Abs[n-m]==1. So you only need to generate a 1D table: tab=Table[Integrate[E^-x^2 HermiteH[n-1,x] x HermiteH[n,x],{x,-\[Infinity],\[Infinity]}],{n,1,5}]; and this result can be fed to FindSequenceFunction ...


6

Your operator must depend on both function and variable - in analogy to D function: logD[f_, x_] := D[f, x]/f or an alternative definition: logD[f_, x_] := D[Log[f], x] Of course your variables of differentiation and in the function must agree. Test it: logD[f[x], x] Derivative[1][f][x]/f[x] logD[Sin[x], x] Cot[x] f = x^2; logD[f, x] ...


6

You could integrate over the region, using Boole: Integrate[ Boole[0 < p < 1 && 0 < e1 < 1/2 && 0 < e2 < 1/2 && (p < e1 || (p) (e1)/((p) (e1) + (1 - p) (1 - e2)) < e1/e2)], {p, 0, 1}, {e1, 0, 1/2}, {e2, 0, 1/2}] (* 1/16 (5 - 6 Log[2] + 2 Log[4]) *)


5

Let f = (Sin[x^2] + Sin[y^2])/(x - y) be the function in question. As pointed out in the answers to this question, finding multivariable limits automatically computationally is full of pitfalls. The idea behind the function lim in this answer was to use Maximum and Minimum to find bounds on the function and apply the squeeze theorem. It fails here ...


5

Following ruebenko's approach, after computing the convex hull you can much faster directly get the volume without triangulating the volume as 1/6 Sum[ Det [ triangle vertices ] ]: Do[ -Total[ Det[{ch[[1, #[[1]]]], ch[[1, #[[2]]]], ch[[1, #[[3]]]]}] & /@ ch[[2]]]/6 , {10}] (* 12.5077 *) This is the 3d shoelace formula: ...


5

We have, for all integer a and n Sum[Fibonacci[n + i], {i, 0, a}] == Fibonacci[n + a + 2] - Fibonacci[n + 1] (-> True) This can be seen by evaluating Table[ Sum[Fibonacci[n + i], {i, 0, a}] == Fibonacci[n + a + 2] - Fibonacci[n + 1], {a, 1, 10}, {n, 1, 10} ] which gives a bunch of True's. You can then simply do n = 1000; fibRatio[a_, b_] := ...


5

The reason is you hit a distribution. partialSum = Sum[Sin[n*x]*Sin[n], {n, 1, bigN}]; (* 1/4 Csc[(1 + x)/2] Sin[1/2 (-1 - 2 bigN - x - 2 bigN x)] -1/4 Csc[(1 - x)/2] Sin[1/2 (-1 - 2 bigN + x + 2 bigN x)] *) and you can immediately see from here (7th from the top) that in the limit bigN->Infinity you get the sum of two Dirac functions centered at ...


5

There is another approach that sometimes works better (gives closed-form expressions rather than recurrence relations): In[1]:= InverseFourierTransform[(-I k)^n FourierTransform[1/(1 + x^2)^Log[2], x, k] , k, x] Out[1]= (2^(-1 + n - 1/2 Log[1/x^2]) Abs[x]^-Log[2] ((-I)^ n ((1 + n) x Gamma[(1 + n)/2] Gamma[ n/2 + Log[2]] ...


5

This is only a hack, but maybe it just gives you short way out of this. Lately, we had a similar discussion in chat about NValues where the problem was related. It this cases Rojo wanted to use NValues to prevent some of the arguments to stay untouched by N. There too, the problem was when N was called from very outside and dived into the subexpressions ...



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