Questions tagged [symbolic]
For questions about symbolic computation, as opposed to numerical computations.
323
questions
53
votes
4
answers
21k
views
How do I work with Root objects?
I want to solve the trigonometric equation :
$$(3-\cos 4x )\cdot (\sin x - \cos x ) = 2.$$
I tried
Solve[(3 - Cos[4*x])*(Sin[x] - Cos[x]) == 2, x]
It returns the ...
66
votes
2
answers
7k
views
Analogue for Maple's dchange - change of variables in differential expressions
Update
Finally in v13.1 the function DSolveChangeVariables is introduced, try it out! DChange in the answer below is still a ...
53
votes
6
answers
42k
views
How to calculate scalar curvature, Ricci tensor and Christoffel symbols in Mathematica?
I am seeking a convenient and effective way to calculate such geometric quantities. I've used packages like TensoriaCalc, but they don't work at all time. Sometimes,...
29
votes
5
answers
6k
views
Extracting variables from an expression
I'm looking for a way to extract a list of variables from an expression, for example with an input like:
...
68
votes
4
answers
20k
views
Can Mathematica do symbolic linear algebra?
For instance, is there some way I can say "let A and B be arbitrary real $m\times n$ and $k\times m$ matrices, Simplify[Transpose[Transpose[A].Transpose[B]]]" and ...
11
votes
3
answers
6k
views
Using D to find a symbolic derivative
I need to do the following:
Define a function
Take the derivative of this function and have a look at the symoblic representation
Substitute in some values
With the bonus that I want to use the ...
12
votes
1
answer
1k
views
Implement finite Fourier transforms
Recently I came across finite Fourier transforms, which can be used for solving certain type of boundary value problem (BVP) of linear partial differential equation (PDE) with constant coefficient. ...
19
votes
4
answers
9k
views
Complex number operations: telling Mathematica variables are real
I want to do Conjugate[a + b*I], but when I do that, the solution is
Conjugate[a] - I*Conjugate[b]; when for me, a and b are ...
87
votes
6
answers
6k
views
Advice for Mathematica as Mathematician's Aid
I use Mathematica mainly as an aid in symbolic attacks on problems, usually intermediate or harder and often number theoretic. While Reduce, ...
14
votes
6
answers
4k
views
Prevent Part[] from trying to extract parts of symbolic expressions
If you have a list, e.g.
{1, 2, 3}
then you can extract the $k$th part using Part (...
32
votes
6
answers
20k
views
Replacing composite variables by a single variable
To replace a single variable by another variable, one can simply use the the replace all (/.) operator (e.g., ...
7
votes
2
answers
2k
views
Why Can't `DSolve` Find a Solution for this ODE?
I wanted to find a basis for the set of solutions of the following ODE.
$$y^{''}+\frac{1}{x^2+1}y^{'}(x)+\left[-1-\frac{1}{x^2+1}\right]y(x)=0$$
But when I try to use ...
6
votes
5
answers
506
views
Is there an analogue of the Variables command for general expressions? [duplicate]
The command
Variables[poly]
gives me a list of all variables that appear in the expression poly, which involved sums, ...
21
votes
1
answer
6k
views
How does Mathematica integrate?
Basically, this question can be considered to be an extenstion to my other question.
What I wanted to do was this integral as homework (it is indefinite BTW so no approximations using Simpson's Rule ...
18
votes
5
answers
9k
views
DSolve not finding solution I expected
Try to solve the following ODE via DSolve
$$
\left\{\begin{aligned}
y'(x)+2 y(x) e^x-y(x)^2 &= e^{2 x}+e^x \\
y'(0) &=1
\end{aligned}\right.
$$
The ...
32
votes
3
answers
6k
views
How to deal with complicated Gaussian integrals in Mathematica?
As we know, for most Gaussian integrals, we can get the analytical
result. Now I have many Gaussian integrals to treat, which have the
following general form,
...
10
votes
4
answers
714
views
How do I invoke the default complexity function?
Documentation on ComplexityFunction says:
With the default setting ComplexityFunction->Automatic, forms are
ranked ...
9
votes
1
answer
300
views
When to use GenerateConditions -> True
Many functions, usuallly those involving integration, take a GenerateConditions option which often defaults to False, or at ...
12
votes
3
answers
991
views
Reduce ODE into 1st order
I have an explicit set of differential equations:
$ \ddot{x}=f(x,\dot{x})$
I would like to reduce it in the following way:
$ \dot{y} = g(y)$
by substitutions as shown here: wikipedia. I have done ...
11
votes
2
answers
2k
views
Why aren't these additions of integrals and summations equal?
I have the following code:
Simplify[Integrate[f[x] + g[x], x] == Integrate[f[x], x] + Integrate[g[x], x]]
To test:
$$\int{\left(f(x) + g(x)\right)dx}=\int{f(x)...
3
votes
4
answers
3k
views
How do I evaluate several n-th derivatives of a function at one point?
I have a question where I have to compute a Table containing $f^{(n)}(0)$ for n = 1, ..., 5, where $f^{(n)}$ denotes the $n$th ...
42
votes
1
answer
2k
views
How can I define a new symbolic constant like Pi?
There are a few builtin symbolic constants which behave like numbers, e.g. E, Pi, EulerGamma,...
32
votes
3
answers
6k
views
How to symbolically do matrix "Block Inversion"?
Consider a block (partitioned) matrix
matrix = ArrayFlatten[{{a, b}, {c, d}}]
where, a, b,...
22
votes
2
answers
2k
views
Incorrect results for elementary integrals when using Integrate
Bug introduced in 8.0 or earlier and persisting through 13.2 or later
There is a rather simple integral ($K_0$ is the 0-th order MacDonald function)
$$\int_0^\infty e^{-x \cosh\xi}\, d\xi = K_0(x)$$
...
18
votes
2
answers
1k
views
How to do algebra on summations of variable expressions?
Is there any easy, general way to handle algebra on variable Sums?
For examples, Gaussian Mixtures or Fourier Series:
...
6
votes
4
answers
892
views
Evaluate the defining Integral of the Bessel functions of the first kind
I am trying to evaluate the integrals
$$ \int\limits_{-\pi}^{\pi} \mathrm{e}^{\mathrm{i}(x\sin t - nt)} \mathrm{d}t $$
and
$$ \int\limits_{-\pi}^{\pi} \mathrm{e}^{\mathrm{i}x\sin t} \mathrm{d}t $$
...
22
votes
2
answers
861
views
Derivative of a pure function with SlotSequence
I can live with this but I can't figure out why the following is 0:
Derivative[1][f[##] &][x]
0
From documentation for ...
12
votes
1
answer
2k
views
Managing Exclusions in Plot[ ]
When I do:
...
10
votes
3
answers
3k
views
Three dimensional Laplacian insulated on lateral faces and convectively exposed on transverse faces (updated)
I have the three dimensional Laplacian $\nabla^2 T(x,y,z)=0$ representing temperature distribution in a cuboid shaped wall which is exposed to two fluids flowing perpendicular to each other on either ...
9
votes
0
answers
153
views
When and why are Assuming and Assumptions not equivalent? [duplicate]
In this question there's an example of an integral where using Assuming and Assumptions give different results:
...
8
votes
8
answers
1k
views
Given a symbolic expression how to find if starts with a minus or not?
I am using a Mathematica function which returns some error term in symbolic form. I needed a way to determine if this term starts with a minus sign or not. There will be only one term. This is to ...
7
votes
3
answers
2k
views
How to implement Einstein summation convention with differential operators
Statement of this problem:
In the textbook, the following differential equilibrium equations can be expressed by tensors:
Using Einstein's summation convention, the formula in the figure above can be ...
39
votes
1
answer
1k
views
How to augment the realm of functions Mathematica thinks it knows how to integrate symbolically
My question involves extending the functionality of Integrate over specific integrals in the most generic manner.
Specifically, is it possible to "hack into" ...
9
votes
3
answers
766
views
Efficient code for solve this equation
We have $a*b*c=-1$, $\frac{a^2}{c}+\frac{b}{c^2}=1$, $a^2 b+a c^2+b^2 c=t$
What's the value of $a^5 c+a b^5+b c^5$?
I tried
...
6
votes
2
answers
2k
views
Compute Hessian of function symbolically
This question could equally apply to the computation of other symbolic transformations of a function, but I use the Hessian as an example here.
Consider a two-variable function ...
2
votes
1
answer
261
views
44
votes
3
answers
4k
views
Symbolic solution(s) to generalized Heat equation
Symbolic solution(s) to Heat equation?
or more generally,(eventually) Green functions to known PDEs
I am interested in variations of the heat equation:
or more generally
or even more generally (<...
38
votes
1
answer
40k
views
Extract real part of a complex expression better than Re does
I have a complex expression with real positive variables only.
Mathematica Input Style:
...
26
votes
1
answer
1k
views
Transform Root objects into Trigonometric expressions
Consider the Root objects
roots = Table[Root[-1 + 27 #1^2 - 162 #1^4 + 243 #1^6 &, i],{i,1,6}]
These can be expressed in terms trigonometric functions as ...
22
votes
2
answers
603
views
What does f_[whoCalled]^:=f really mean?
I came across the following post by John Doty in this Google Groups discussion:
On Friday, January 11, 2013 8:23:16 PM UTC-7, amzoti wrote:
It is clear the Mathematica uses Lisp as one ...
18
votes
2
answers
4k
views
Non-commutative symbolic linear algebra
I am fairly new to Mathematica but I thought I would be a helpful tool to carry out a few simple linear algebra calculations. It seems like an easy task but I cannot figure out how to do it. For ...
16
votes
5
answers
4k
views
How to get exact roots of this polynomial?
The equation $$ 64x^7 -112x^5 -8x^4 +56x^3 +8x^2 -7x - 1 = 0 $$
has seven solutions $x = 1$, $x = -\dfrac{1}{2}$ and $x = \cos \dfrac{2n\pi}{11}$, where $n$ runs from $1$ to $5$. With ...
13
votes
3
answers
4k
views
Telling mathematica to output * instead of space for multiplication, so I can copy as plain text
I am trying to get some symbolic expressions in Mathematica
which I would like to paste into my C/MATLAB codes. This can be accomplished
nicely by selecting the expression and right-clicking to ...
12
votes
1
answer
1k
views
Is there a way to see the result of NIntegrate's symbolic preprocessing?
NIntegrate can do a number of different types of symbolic preprocessing on the integrand before starting the numerical calculations, including changes of variables.
...
12
votes
1
answer
584
views
Why does Assuming[x > 0, TrueQ[x > 0]] return False?
Assuming[x>0,TrueQ[x>0]]
should, as I understand it, test TrueQ[x>0] after assuming ...
11
votes
2
answers
2k
views
Find closed form expression for series expansion coefficients [duplicate]
Is there a built-in function that will find a general expression for the coefficient of the series expansion of a function?
Series will only give the explicit ...
11
votes
2
answers
880
views
Symbolic tensor simplifications and the identity matrix
How can I get Mathematica to simplify the following expressions, with $Assumptions including Element[n,Integers], n > 0, and <...
9
votes
2
answers
1k
views
Bug in Integrate for Mathematica
Bug introduced in 8.0.0 and fixed in 9.0.0
Consider the following:
...
8
votes
0
answers
276
views
Spurious DSolve Solution
Bug introduced in 8.0.4 or earlier, persisting through 13.2.
DSolve quickly returns solutions to the following PDE (which is the homogeneous portion of the PDE in ...
8
votes
3
answers
1k
views
Exact Differentials
I just started using Mathematica so my apologies if this is a very basic question. I tried to find related questions on this forum but couldn't, so here goes. I have an equation,
$\quad \quad dp =\...