New answers tagged

2

If you look at the documentation for Series Then you can see that Series[f,{x,Subscript[x, 0],n}] generates a power series expansion for f about the point x=Subscript[x, 0] to order (x-Subscript[x, 0])^n So if you want more terms, then simply change n to something else. Like 5, for example. In[6]:= Series[(1 - Cos[x])/x, {x, 0, 5}] ...


11

Here's a way to leverage the Clenshaw-Curtis rule of NIntegrate and Anton Antonov's answer, Determining which rule NIntegrate selects automatically, to construct a piecewise Chebyshev series for a function. It also turns out that InterpolatingFunction implements a Chebyshev series approximation as one of its interpolating units (undocumented). With ...


2

Just an extension to Alexei Boulbitch's answer: if you want to highlight x, you can change the function to: Clear[rule]; expr = Expand[(x + y) (x + z) (x + w)]; rule[x_] := {Power[x, y_] :> Power[x, y], x :> Style[x, Background -> Yellow]}


2

Try this: expr = Expand[(x + y) (x + z) (x + w)]; rule[x_] := x -> Style[x, Background -> Yellow]; Then you may apply the rule to the expression as follows expr /. rule[x^3] with the effect or expr /. rule[x^2] giving but the most simple substitution expr /. rule[x] does not work, since it highlights all terms containing x. But ...


2

One way could be using a Style. Expand[(x + y) (x + z) (x + w)] /. {x^2 -> Style[x^2, Red, Background -> LightBlue]}


10

Note that the expression returned by Sum is correct and equals $x(1-x)$ for $0 \leq x \leq 1$. I assume your question is how to simplify the expression into $x(1-x)$? I was able to hack a solution, and unfortunately I don't think it scales very well to other expressions. But here goes: First, evaluate the sum: sum = 1/6 - Sum[Cos[2 x Pi n]/(Pi n)^2, {n, ...


2

This is a bit tricky, but if you look in the docs under SeriesData, it says When you apply certain mathematical operations to SeriesData objects, new SeriesData objects truncated to the appropriate order are produced. That explains this interesting series of events: Series[f[s + h], {h, 0, 2}] g[h] - % Series[g[h] - f[s + h], {h, 0, 2}] Normal@% - ...


1

Normal@Series[BesselK[1, r Λ]/BesselK[1, Λ], {r, 0, 1}, Assumptions -> Λ > 0] gives You can also use Simplify@Normal@Series[BesselK[1, r Λ]/BesselK[1, Λ], {r, 0, 1}, Assumptions -> Λ > 0] or Simplify[Normal@ Series[BesselK[1, r Λ]/ BesselK[1, Λ], {r, 0, 1}], Assumptions -> Λ > 0] or Assuming[{ Λ > 0}, ...


4

The challenge is that Series[f[x], {x, 1, n}] creates an expansion in terms of x - 1. Since (1 - x^4)^(-1/4) is complex for x > 1, so are the expansion coefficients. If Series did its expansion for 0 < x < 1, as given in $Assumptions, in terms of 1 - x, real coefficients would result instead. A comment by J.M. in Question 112291 suggests how this ...


1

This is your equation: eq= f''[x]+(2 Exp[-k*x]/x-e) f[x]==0 For a given value of max, you are looking for a series solution sol: max=5; sol=Function[x, Sum[c[i] x^i, {i,1,max}] + O[x]^max] Substitute this solution in your equation and use the function SolveAlways for finding the coefficients: SolveAlways[eq /. f->sol, x] (* {{c[4]->-(1/36) (2+4 ...


1

Probably something like this can be done: n = 5; (* highest-order term *) f = Sum[C[k] ρ^k, {k, 1, n}] + O[ρ]^(n + 1); (* C[0] == 0 already imposed *) Solve[Thread[CoefficientList[D[f, {ρ, 2}] + (2 Exp[-k ρ]/ρ - ε) f, ρ] == 0], Array[C, n]] // Simplify {{C[2] -> -C[1], C[3] -> 1/6 (2 + 2 k + ε) C[1], C[4] -> -(1/36) (2 + 8 k + 3 k^2 ...



Top 50 recent answers are included