Tag Info

New answers tagged

4

Here is a trick that allows you to get exactly what you're looking for: FourierTransform[ InverseFourierTransform[x/y DiracDelta[x - y], x, k], k, x] DiracDelta[x - y] What I did here is to apply the Fourier transform and its inverse, which is of course the identity and therefore is equivalent to the original expression. But in doing so, Mathematica ...


0

DiracDelta must be inside an integral to have much meaning. From its documentation: "DiracDelta can be used in integrals, integral transforms, and differential equations. " Assuming[Element[y, Reals], Integrate[x/y DiracDelta[x - y], {x, -Infinity, Infinity}]] 1 Assuming[Element[x, Reals], Integrate[x/y DiracDelta[x - y], {y, -Infinity, Infinity}]] ...


1

In Mathematica 10 using << Notation` Notation[x' => xPrime] seems to work to "disconnect" x' from its meaning as a derivative. (Note- the Notation text used here represents entering using the Notation Palette. Mathematica interprets this to Notation[ParsedBoxWrapper[ RowBox[{"x", "'"}]] \[DoubleLongRightArrow] ParsedBoxWrapper["xPrime"] ] ...


0

h[f[0]] := f[0]; h[f[1]] := f[1]; h[f[x_]] := f[x - 1] + f[x - 2]; nst[n_, num_] := Total@Nest[Cases[#, f[y_] :> h[f[y]], Infinity] &,{f[n]}, num] Testing: Table[nst[10, j], {j, 0, 9}] // TableForm


3

If you're using M10, you could do it with Inactivate (which formats more nicely in Mathematica than it does here in plain text.) Inactivate[f[7] /. #, f] &[DownValues[f]] (* Inactive[f][5] + Inactive[f][6] *) Then Nest it: Clear[step]; SetAttributes[step, HoldFirst]; step[e_] := step[e, 1] step[e_, n_] := Inactivate[Nest[Function[{x}, x /. #], e, n], ...


3

The answers are great. I wanted to add that the problem you are trying to solve fits way better with replacement rules than function definitions, so switching to those can provide a more understandable answer Clear[f]; frules = {f[0 | 1] :> 1, f[n_] :> f[n - 1] + f[n - 2]}; f[7] /. frules (* same as f[7]//ReplaceAll[frules] *) f[7] /. frules /. ...


7

If we are willing to confine ourselves to functions like the example f which: is defined using DownValues only, and has no special attributes such as HoldAll, etc. ... then the following lifting function might be useful: ClearAll[stepper] SetAttributes[stepper, HoldAll] stepper[f_Symbol] := Module[{rules, g} , rules = Rule @@@ ...


16

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


1

For the moment leaving aside the wisdom of using Subscripts as Symbols in Mathematica it would appear that your immediate problem has nothing to do with Subscript at all but rather the behavior of Variables. Recall its definition: Variables[poly] gives a list of all independent variables in a polynomial. And observe that even when using true Symbols ...


1

Let M = CAC^(-1), s(k) = - CAC^(-1)y(k) + B r(k) + D r(k+1) then the recursion becomes eq = y[k + 1] == M y[k] + s[k] The solution with the initial condition y[0]==y0 is sol = RSolve[eq && y[0] == y0, y[k], k] $\left\{\left\{y[k]\to M^{-1+k} \left(M \text{y0}+\sum _{K[1]=0}^{-1+k} M^{-K[1]} s[K[1]]\right)\right\}\right\}$ Extracting y[k] ...


2

Coefficient[E^(I a (t - b)) // ExpandAll, E^(I a t)] (* Exp[-I a b] *)


3

The following gives what you intended: Refine[Expand[P[x, y]^2], (x|y|beta) \[Element] Reals] (* ==> Conjugate[z[y]]^2/E^((2*I)*beta*x) + 2*Conjugate[z[y]]*z[y] + E^((2*I)*beta*x)*z[y]^2 *) In cases where you can live with expansion of complex exponentials into Sin and Cos you can also use ComplexExpand[P[x, y]^2, z[y], ...


2

If you are going to work with non-commutative algebras like the matrix multiplication I recommend you try the NCAlgebra package. << NC` << NCAlgebra` (2 a) ** (3 b) 6 a ** b P.S. In NCAlgebra all lowercase variables are non-commutative by default.


0

There is this package from MathSource, which contains a number of similar packages. Various packages dealing with Lie groups have also been proposed over the years. Your mileage may vary.


0

$Version "10.0 for Mac OS X x86 (64-bit) (September 10, 2014)" $Assumptions = {a > 1}; Integrate[1/Sqrt[-1 + a^2*Sech[x]^2], {x, 0, ArcCosh[a]}] Pi/2 f[a_?NumericQ] := Module[ {ar = Rationalize[a, 0]}, NIntegrate[ 1/Sqrt[-1 + ar^2*Sech[x]^2], {x, 0, ArcCosh[ar]}, WorkingPrecision -> 20] // Chop] ...


2

It seems to be a branch cut issue. It depends when the substitution is done, that causes the integrator to go one way vs. the other. This below shows difference ClearAll[x, a]; sol = Integrate[1/Sqrt[-1 + a^2*Sech[x]^2], x] The integrand at x=0 is always zero, so we can ignore this, The issue is with the upper limit low = Limit[sol, x -> 0] (*0*) ...



Top 50 recent answers are included