Skip to main content

New answers tagged

4 votes

Why does Replace function not work the first time I try it?

The problem is that the expression doesn't have g[x]/x just isolated from Cos[x]: ...
Sjoerd Smit's user avatar
2 votes

Why does Replace function not work the first time I try it?

Three errors: Execute cells separately if you refer its result. Use :> instead of -> to avoid evaluation of rules already at input time. Don't use %, it was created for the math.exe text input. ...
Roland F's user avatar
  • 3,965
4 votes
Accepted

How to handle undefined Integral results for excluded conditions in Mathematica

To get rid of condition like If I use a trick: ...
Mariusz Iwaniuk's user avatar
3 votes
Accepted

How to run Integrate[Sqrt[(x - a)^2 + (y - b)^2 + (z - c)^2], Element[{x, y, z}, Ball[{0, 0, 0}, 1]], Element[{a, b, c}, Ball[{0, 0, 0}, 1]]]

I'll redo the math from this solution for the more general case of $$ \int_{\text{ball}(R_1)}d^3\vec{r}_1 \int_{\text{ball}(R_2)}d^3\vec{r}_2 \|\vec{r}_1-\vec{r}_2\|^{2n} $$ of which you'll use $R_1=...
Roman's user avatar
  • 48.8k
1 vote

LineIntegrate seemingly does not work

Try LineIntegrate[1/(x + I y), {x, y} \[Element] Circle[]] LineIntegrate[1/Abs[x + I y], {x, y} \[Element] Circle[]]
houzw's user avatar
  • 811
3 votes

Mathematica integral wrong

The result is totally wrong. This integral isn't too hard to do in spherical coordinates. Start with the interaction between two spherical shells of radii $r$ and $r_1$. Let $\{x,y,z\}=\{0,0,r\}$ (we ...
Roman's user avatar
  • 48.8k
-2 votes

Mathematica integral wrong

The result is mathematically correct, therefore there is no bug in Mathematica. What you are trying to compute is this integral $$ \mathcal{I}=\int_{B_R^3}\int_{B_{R_1}^3}\frac{1}{|\mathbf{x}-\mathbf{...
SonerAlbayrak's user avatar
0 votes

How to find the local maximum and minimum of a function

Example for domain $(0,2\pi)$ coloring maximum green and minimum red: ...
ubpdqn's user avatar
  • 62.8k
3 votes
Accepted

Problem computing a limit

Sum[] is difficult to handle in general, and it seems to be why Limit[] is so slow. In this case, it's a polynomial and its ...
Michael E2's user avatar
  • 239k
1 vote

Allan Variance integral for a first order Markov process

You can add Assumptions to Integrate: ...
tad's user avatar
  • 2,180
4 votes

Convergence of $\left\{n!\sum_{k=1}^{n!}\frac{1}{k^{\frac{3}{2}}}\right\}$ as $n\to \infty$ using Mathematica or otherwise

Let's change n! to nfact. ...
Daniel Lichtblau's user avatar
3 votes

Problem computing a limit

The problems seems that for different $j$ you can get 1/0 division depending on what $x$ value is. So without having specific value of $j$ might not be possible. ...
Nasser's user avatar
  • 147k
1 vote

Convergence of $\left\{n!\sum_{k=1}^{n!}\frac{1}{k^{\frac{3}{2}}}\right\}$ as $n\to \infty$ using Mathematica or otherwise

Let's define some functions to evaluate these numbers at high accuracy: ...
Roman's user avatar
  • 48.8k
3 votes

NDsolve does not solve equation

Here is an example that actually runs without messages, fixing a number of errors in @zeraoulia rafik's code and adjusting parameter values to make a nice plot: ...
Michael E2's user avatar
  • 239k
-1 votes

NDsolve does not solve equation

According to the recommendations given by @Nasser in the comment above, I have tried to show your solutions by adding the missing numerical values for your parameters and initial condition values. I ...
zeraoulia rafik's user avatar
0 votes

Integration of Gaussian functions takes ages

You ran into the mess that Mathematica has with its definite integral input check. They try a list of known algorithms, primarily in the real line residues., The alternative of doing the indefinite ...
Roland F's user avatar
  • 3,965
5 votes

What methods can quickly determine the coefficient of determination of the data?

If you want to be "old school" (using linear algebra): ...
ubpdqn's user avatar
  • 62.8k
4 votes

Mathematica integral wrong

Not an answer, but this won't fit in comment: ...
Craig Carter's user avatar
  • 4,625
6 votes
Accepted

How is the result of this integral obtained by the function `Integrate`?

I'm not sure if this is an intended behavior or a bug in Mathematica's end, but it does make sense to get different results. Below, I show how to get both results as desired. EDIT: Some people ...
SonerAlbayrak's user avatar
1 vote

Numerical approximation of the integral by using data

...
eldo's user avatar
  • 81.8k
0 votes

Finding an increasing or decreasing function

Reduce[(x^2 - 3^x)/x > 0] $-\frac{2 W\left(\frac{\log (3)}{2}\right)}{\log (3)}<x<0$
David G. Stork's user avatar
2 votes

Confused about the output of `CosIntegral`

CosIntegral[z] is equivalent to the (complex!) integral ...
Michael E2's user avatar
  • 239k
2 votes

Confused about the output of `CosIntegral`

Two things: $\cos (\pi x)/x$ is an odd function, not even! Other than that you are (I think) confusing two functions, let's just assume real $x$ the CosIntegral[x] ...
Nitaa a's user avatar
  • 790
1 vote

Checking the sign value of the derivatives of a complicated function

Function e[w]only depends on two parameters a i W and i+lambda ...
Ulrich Neumann's user avatar
3 votes

Integration with respect to functions

The Mathematica result seems to be correct if we assume Integrate[x, f[x]]==Integrate[x f'[x]],x] Integration by parts ...
Ulrich Neumann's user avatar
4 votes

Integration with respect to functions

You can write is as \begin{align*} \int xd\left( f\left( x\right) \right) & =\int x\frac{df}{dx}dx\\ & =\int xf^{\prime}dx \end{align*} And Mathematica gives now ...
Nasser's user avatar
  • 147k
1 vote

Partial Derivative after Numerical Integration of a Complicated Expression with Singularity at Zero

Maybe this can get you going, not sure it is all correct, the graph looks a bit different, but maybe with more points and fixing ColorFunction and ...
Rolf Mertig's user avatar
  • 17.2k
1 vote

Partial Derivative after Numerical Integration of a Complicated Expression with Singularity at Zero

Do you realize that you have about 1.97506*10^10 oscillations per unit change in k for smallish ...
Michael E2's user avatar
  • 239k
1 vote

How is the result of this integral obtained by the function `Integrate`?

Workaround: ...
Mariusz Iwaniuk's user avatar
2 votes

How is the result of this integral obtained by the function `Integrate`?

It is a bug in Integrate. The numerical result seems to be the correct one. You can use Rubi integrator for workaround meanwhile. ...
Nasser's user avatar
  • 147k
1 vote

Plotting a parametric function on xy, xz, and yz planes

Using ProjectGraphics3D by Wolfram Staff ...
eldo's user avatar
  • 81.8k
0 votes

How to get multiplication of the elements of a specific list/matrix

list = {a, b, c, d}; Using AccumulateApply by Ian Ford and Jon McLoone ...
eldo's user avatar
  • 81.8k
2 votes
Accepted

StreamPlot3d for the magnetic field of a loop

If you prevent the definition of Bx, By, Bz to be evaluated for symbolic argument and and introduce "Thread" in their definition you can get a reasonable time for evaluation. Further note, ...
Daniel Huber's user avatar
  • 53.7k
8 votes

Integration of the product of two exponential functions

General formula exist. Can be expressed by FoxH function: ...
Mariusz Iwaniuk's user avatar
4 votes

Integration of the product of two exponential functions

This also shows that for different values of $a$, solutions can be very different. So general formula is most likely do not exist. Mathematica also hangs on some specific values of $a$. So I put time ...
Nasser's user avatar
  • 147k
4 votes

Integration of the product of two exponential functions

Probably no closed formula for this integral is known for general value of a. As commented by @mikado, you can get a (complicated) formula if a is a rational number. For example, ...
A. Kato's user avatar
  • 1,550
1 vote

Integration involving Piecewise function and DiracDelta function

to long for a comment: Analytical solution approach My numerical answer Numerical solution using Convolution property gives the reduced integration range ...
Ulrich Neumann's user avatar
2 votes
Accepted

Integrate diverges for convergent integral, and returns unnecessary condition

Why did the original integral failed if the finite integral converges at the limit? Try ...
Nasser's user avatar
  • 147k
2 votes

Integration involving Piecewise function and DiracDelta function

Numerical solution using Convolution property (german: "Ausblendeigenschaft") of DiracDelta[] (only case x=3/2) ...
Ulrich Neumann's user avatar
3 votes

Integration involving Piecewise function and DiracDelta function

Here is a mixed algebraic/numerical solution. EDIT: I have now improved this to a fully algebraic solution. For "version control" I have appended the update to the end of my original ...
Stephen Luttrell's user avatar
3 votes

Possible bug in partial derivative

The case for $x=y$ should be undefined as is evident from: Plot3D[Min[x, y], {x, -1, 1}, {y, -1, 1}, Mesh -> None] You can "work around" using ...
ubpdqn's user avatar
  • 62.8k
3 votes

Possible bug in partial derivative

A problem here is that we cannot know the a priori relationship between x and y, which means D[Min[x, x], x] should return 1 ...
houzw's user avatar
  • 811
9 votes

Possible bug in partial derivative

From the documentation for Piecewise, "Possible Issues": Derivatives are computed piece-by-piece, unless the function is univariate in a real variable... ...
Goofy's user avatar
  • 3,569
2 votes

Numerical approximation of the integral by using data

...
eldo's user avatar
  • 81.8k
1 vote

Slope of a line

data = {{x1, y1}, {x2, y2}}; A variant of Bob Hanlon's slope3 using ReverseApplied (new in ...
eldo's user avatar
  • 81.8k
5 votes
Accepted

Possible bug in partial derivative

It is not clear why sometimes you take a limit and sometimes you just substitute the value. Consider ...
yarchik's user avatar
  • 19.2k
2 votes
Accepted

Describing the region of integration $\mathbb{R}_+^n$ for arbitrary $n$

Instead of using "list" variables, like x = {x1, x2, ...}, use "indexed" variables, x[1], x[2], ..., which ...
Domen's user avatar
  • 27.9k
2 votes

Numerical approximation of the integral by using data

...
E. Chan-López's user avatar
6 votes

Numerical approximation of the integral by using data

I think @Roman's modification of @JocelynMinini's use of Interpolation + Integrate is easy to code, easy to understand, and ...
Michael E2's user avatar
  • 239k
4 votes

Possible bug in partial derivative

...
Bob Hanlon's user avatar
  • 160k

Top 50 recent answers are included