Tag Info

Hot answers tagged

16

If you're new to Mathematica, then it might make sense to explore these kinds of basic things via the natural language interface. Assuming that you're connected to the internet, so Mathematica can access WolframAlpha's servers, just type = power series sinx Note that the equals sign will be reformatted to look like it's part of the WolframAlpha input ...


14

(Edited; original at the end) Gram-Schmidt orthogonalization provides an answer. Let's use a running example to illustrate. It begins even before the Chebyshev polynomials, with their domain--the interval $[-1,1]$--and the kernel for which they are orthogonal: limits = {-1, 1}; k[x_] := 2/Sqrt[1 - x^2]/Pi; The Chebyshev polynomials are obtained by ...


13

You want first to fix any typographical errors (such as the unbalanced parentheses) and it's also wise to avoid symbol names beginning with capital letters. Then, to obtain a series expansion in powers of $1/z$, expand the expression around infinity, not zero: Series[a + b (1 - Exp[-t/(b c)]/(z - Exp[-t/(b c)])) , {z, Infinity, 5}] $(a+b)-\frac{b ...


12

Is InverseSeries what you are looking for? InverseSeries[Series[ArcTan[Log[1 + x]/(1 + x)], {x, 0, 5}]] (* x+(3 x^2)/2+3 x^3+(149 x^4)/24+(68 x^5)/5+O[x]^6 *) EDIT: looks reasonable: Plot[{ pl[x], invs }, {x, -.3, .3}, PlotStyle -> {{Dashed, Black}, Red} ] Who knows what the radius of convergence is, though.


9

It's true that the multivariable version of Series can't be used for your purpose, but it's still pretty straightforward to get the desired order by introducing a dummy variable t as follows: Normal[Series[f[(x - x0) t + x0, (y - y0) t + y0], {t, 0, 2}]] /. t -> 1 $(x-\text{x0}) (y-\text{y0}) f^{(1,1)}(\text{x0},\text{y0})+\frac{1}{2} ...


9

After you define your function execute this line: Series[f, {x, \[Infinity], 1}] // Normal // PowerExpand Following your $x \gg a$ we can rewrite it as % /. (-a + x) -> x // FullSimplify which gives: Now you have to be very careful dealing with derivative. It is not enough to keep 0th and 1st terms (as you did) - you will loose information. ...


9

Had InverseSeries[] not been a built-in function, one option might be to invert the Carleman matrix corresponding to the function: CarlemanMatrix[f_, {x_, x0_, {m_Integer, n_Integer}}] := Prepend[Table[ If[k == 0, Function[x, f][x0]^j, BellY[Table[{FactorialPower[j, i] Which[#2 == 0, 1, #1 == 0, 0, True, #1^#2] &[Function[x, f][x0], j - ...


9

Be explicit and do it in two steps. The first step is just the series computation with the matrix expression M+S replaced by a single variable: f = Series[(1 + t x)^(-1), {t, 0, 3}] $1-x t+x^2 t^2-x^3 t^3+O[t]^4$ We need to describe how to expand powers of x. This can be done recursively: power[a_, n_Integer] /; n > 1 := Distribute[a . power[a, ...


9

The Hermite polynomials are orthogonal with respect to the inner product $$\langle f,g \rangle = \int_{-\infty}^{\infty} f(x)g(x)e^{-x^2} \, dx.$$ Thus, the nth coefficient can be computed using the inner product of your polynomial with the nth normalized Hermite polynomial. Example: p[x_] = 1 + x + x^2 + x^3; coeffs = Table[ Integrate[HermiteH[n, ...


7

For polynomials, you don't need to do any integrals to find the expansion. Take a polynomial p and a list basis containing the basis functions. Then define a function that takes these two, identifies the variable x, and solves for the coefficients in basis that make the two polynomials equal in terms of their CoefficientLists: expandPoly[p_, basis_, x_] := ...


6

The inner product for the Hermite polynomials, $$\langle f, g\rangle \int_{-\infty}^{\infty} f(x)\,g(x)\,e^{-x^2}\;dx\,,$$ has nice formulas for power functions (where $n=a+b$) and for the Hermite polynomials: $$ \begin{align} \langle x^a, x^b \rangle = \langle x^n, 1\rangle &= \frac{1}{2} \left((-1)^n+1\right)\, \Gamma \left(\frac{n+1}{2}\right)\cr ...


6

Method I (1) Take series at infinity to get a (Laurent) polynomial. (2) Find largest exponent. (3) Find corresponding coefficient. mainTerm[expr_, x_] := Module[ {approxpoly, prec = 1, j = 0, expon, coef}, approxpoly = Normal[Series[expr, {x, Infinity, prec}]]; While[approxpoly === 0 && j <= 5, j++; prec = 2*prec + j; approxpoly ...


5

f[r_] := 3^(1/3)*Exp[-2*r/3]/Pi^(2/3) - (2*Pi)^(1/3)* Exp[2*r/3]/(5*(3*Pi^(1/3)*Exp[2*r/3]* ArcSin[2*(2*Pi)^(1/3)*Exp[2*r/3]]/(5*2^(2/3)) + 1)) In this case you might just observe that there is a commonly appearing expression Exp[2*r/3]. Substitute in a enw variable and expand a series at infinity in both variables. Then replace the substituted ...


5

You can use the Limit function: f[r_] := -((3^(1/3) E^(-2 r/3))/\[Pi]^(2/3)) - (E^(2 r/3) (2 \[Pi])^(1/ 3))/(5 (1 + (3 E^(2 r/3) \[Pi]^(1/3) ArcSinh[ 2 E^(2 r/3) (2 \[Pi])^(1/3)])/(5 2^(2/3)))) Limit[f[r], r -> \[Infinity]] ...which returns 0. Plotting shows that this is correct: Plot[f[r], {r, 1, 10000}, PlotRange -> All]


5

Is $$\begin{split} 1+&(M+S) \, a\\ +&(M\cdot S+S\cdot M+M\cdot M+S\cdot S) \, a^2\\ +&(M\cdot M\cdot S+M\cdot S\cdot M+M\cdot S\cdot S\\ &+S\cdot M\cdot M+S\cdot M\cdot S+S\cdot S\cdot M+M\cdot M\cdot M+S\cdot S\cdot S) \, a^3\\ +&O\left(a^4\right) \end{split}$$ what you're expecting for? If yes, please continue read. First we define a ...


5

You have to remove the O[_]^_ from your input: Series[{0, -((R^2 ν (2 + (-1 + ν (2 + ν)) Cos[2 θ]))/((-1 + ν) (1 + ν^2) r^2)) + (R^4 ν (-7 + 5 ν (2 + ν) + 16 Cos[2 θ] + (-1 + 3 ν (2 + ν)) Cos[4 θ]))/(4 (-1 + ν) (1 + ν^2) r^4), -((R^2 ν (3 + ν) Cos[θ] Sin[θ])/((1 + ν^2) r^3)), 0}, {r, Infinity, 3}]


4

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


4

One slick way to compute the coefficients $c_k$ in the Laurent series $$f(z)=\sum_{k\in\mathbb Z} c_k (z-a)^k$$ is to recognize that the problem of computing them is equivalent to the problem of computing Fourier coefficients, if you take the contour $\gamma$ in the definition for Laurent coefficients, $$c_k=\frac1{2\pi i} \oint_\gamma \frac{f(z)\,\mathrm ...


4

You can do a series expansion about $a=0$. Series[f, {a, 0, 1}] // Normal // PowerExpand // Collect[#, x, Simplify] & $$ -\frac{a}{2}+x+b x^{\frac{1}{12} \left(7-\sqrt{73}\right)}-\frac{\left(-91+\sqrt{73}\right) a b x^{-1+\frac{1}{12} \left(7-\sqrt{73}\right)}}{48 \left(6+\sqrt{73}\right)} $$ Series[D[f, x], {a, 0, 1}] // Normal // PowerExpand // ...


4

The solution to this requires just a minor modification of my answer here: ClearAll[limitingTerm1] SetAttributes[limitingTerm1, HoldAll] limitingTerm1[expr_, var_Symbol, func_] := var^Exponent[#, var, func] &@Simplify[expr] This gives the right answer for both the examples provided by the OP: limitingTerm1[(x^2 + x)/(x + 1), x, Max] (* x *) ...


4

Here's an attempt: multiTaylor[f_, {vars_?VectorQ, pt_?VectorQ, n_Integer?NonNegative}] := Sum[Nest[(vars - pt).# &, (D[f, {vars, k}] /. Thread[vars -> pt]), k]/k!, {k, 0, n}, Method -> "Procedural"] multiTaylor[f[x, y], {{x, y}, {0, 0}, 2}] f[0, 0] + y*Derivative[0, 1][f][0, 0] + x*Derivative[1, ...


2

You could do something like: b[i_, x_] := ChebyshevT[i - 1, x];(*Tch basis as an example*) app[f_, pSet_]:= Solve[Table[Sum[a@i b[i, x], {i,Length@#}]==f@x, {x, #}], Array[a,Length@#]] &@ pSet Where pSet is the list of points (x-values) you use for equaling the functions. Use it like this: app[# + 31 #^3 + 5 #^25 &, Range@5] Edit Note ...


1

Let us define tt=Log[(1 - E^((I Pi (1 - a))/(b - a)) z)/(1 - E^(-((I Pi (1 - a))/(b - a))) z)]; Then, in order to get the Series expansion coefficient to any order coef= SeriesCoefficient[tt, {z, 0, n}] // FullSimplify (* -((2 I sin((π (a-1) n)/(a-b)))/n) *) Indeed tt2=Sum[coef[[1, 1, 1]] z^n, {n,1, Infinity}]-tt is null. If you want to ...


1

As another variation, here's another method based on repeated greedy division: Reap[Fold[Block[{q, r}, {q, r} = PolynomialQuotientRemainder[#1, #2, x]; Sow[q]; r] &, x^3 + x^2 + x + 1, HermiteH[Range[3, 0, -1], x]]][[-1, 1]] // Reverse {3/2, 5/4, 1/4, 1/8} Check: %.HermiteH[Range[0, 3], x] == x^3 + x^2 + x + 1 // Expand True


1

Whenever I want to convert some polynomial expressed with respect to a certain basis in terms of another polynomial basis. my go-to algorithm is Salzer's algorithm. It's rather fast, since it relies only on recurrences. Here's a specialization of that algorithm for the case of monomial-Hermite conversion: monomialToHermite[cofs_?VectorQ] := Module[{n = ...


1

One simple way would be something like this: Column@Apply[List, Collect[Sum[Expand[(a - b)^i] X[i, j], {i, 3}, {j, 3}], _X] /. y_*z_X :> Row[{Style[z, Bold, Red, 22] , "*(", y, ")"}]]


1

Of course it's absolutely impossible to give a specific answer, so I can only remark that SeriesCoefficient works differently in version 9. For a list or array of functions, version 8 does not evaluate expressions like this: SeriesCoefficient[{f[x], h[x]}, {x, 0, 2}] but version 9 does. Maybe this causes problems somewhere in your expression. But really, ...


1

It is not quite clear, why do you expand the expression around 0, if you want to study its behavior in infinity? I trust that it is not its limit at infinity that you are interested in, since this limit is clear without any calculations. You need probably one or few largest terms. I would in this case go to a new variable x=Exp[-2r] that tends to zero, when ...


1

This integral is doable using the following method: 1) Expand the integrant 2) TrigExpand the result 3) apply the following rule (to collect for a[1]) Exp[x_] :> Exp[Collect[x, a[1]]] 4) apply (possibly in //) this rule to the terms which do not involve a[1] Exp[Complex[0, c_] a[1] + b_.] -> (2*E^b*Sinh[Pi*(Complex[0, c])])/(Complex[0, c])} ...


1

Preliminary First let me change the PDE that is being solve to make things go a bit faster: k = 0.0677; {xMin, xMax} = {-(\[Pi]/k), \[Pi]/k}; TMax = 100; uSol[t_, x_] = u[t, x] /. NDSolve[{\!\( \*SubscriptBox[\(\[PartialD]\), \(t\)]\(u[t, x]\)\) == (u[t, x] \!\( \*SubscriptBox[\(\[PartialD]\), \(x, x\)]\(u[t, x]\)\)), u[0, x] == 1 - 0.1 Cos[k x], ...



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