simplifying expressions – Simplify is giving wrong result in Mathematica

I am trying to do a simple multiplication of variables in Mathematica:

Simplify(n*(n + 1)*(n + 2)) /. {n -> 6*p + 1}

This gives me the output:

(1 + 6 p)^2 (2 + 6 p)

However, this is clearly wrong (unless I missed something).

The same things happens with Factor:

Factor(n*(n + 1)*(n + 2)) /. {n -> 6*p + 1}

I get the output:

12 p (1 + 3 p) (2 + 6 p)

This is also incorrect.

The correct answer would have been:

6 (6p + 1) (3p + 1) (2p + 1)

Why is Mathematica giving different results and how can I get the correct results?


Bitcoin's Price Rise Could Be A Result Of High Investment Activity

As of writing this, bitcoin’s value has gone up to $10000 and is expected to increase more due to the halving. Investors are buying more and more bitcoin in the hopes of seeing a great surge after the halving.

How to add static pages in the Magento 2 search result?

I’m using a Magento 2.4 and in my project I have many static pages that I would like to be part of my search results.

Magento 2 search

How could I add Magento 2 static pages in my search results?

theming – Show result of current selected value in drupal 8 better expose filter used multiple filter

I want to pass only the current selected value/ want result of current selected value even if there previous selected value in Better expose filter.

I have taxonomy term with multiple term that I using in the view.

Say A B c D E having terms A – A1, A2, A3 B- B1, B2, B3 and so on

If user select A2 then he select B3 the data should shown on B3

Means previous selected terms value should not be shown only the current selected term related value should be shown

enter image description here

computational geometry – For two sets of points find if second one is result of linear transformation of the first

Say we have two sets of points in vector-2 space (In actuality need to solve this problem in vector-3 space but decided to start with a simpler problem). The points in the second set are the result of transformation of the points in the first set. It’s not known which point in the first set corresponds to which point in the second set. What needs to be calculated is if the points of the second set can be seen as the linear transformation of the first set. So basically finding whether there exists a 2 by 2 matrix, which if applied to the first set gives the second set. And if so calculating it.

Should a problem like this be solved using computational geometry, like sweep line algorithm to compare all points between sets?

Is there any way to sort the search result by name?

Is there any way to sort the search result by name?

Suppose I have one product name as custom engine. When I search in the search bar, only the custom engine product should come.

Can I do it through front-end or back-end? Please help me guys.

When to trust the result of numerical integration in mathematica?

How does one know when to trust the result of numerical integration, using NIntegrate, for higher (5 or 6) dimensional integrals in mathematica? For example, I get the following result

In(3):= Integrate( Exp(-a^2 - b^2 - c^2 - x^2 - y^2 - z^2), {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, {a, -2, 2}, {b, -2, 2}, {c, -2, 2}) // N

Out(3)= 30.1462

whereas if I do the same integral numerically, I get

In(2):= NIntegrate( Exp(-a^2 - b^2 - c^2 - x^2 - y^2 - z^2), {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, {a, -2, 2}, {b, -2, 2}, {c, -2, 2}) // N

During evaluation of In(2):= NIntegrate::eincr: The global error of the strategy
 GlobalAdaptive has increased more than 2000 times. The global error is expected
 to decrease monotonically after a number of integrand evaluations. Suspect one
 of the following: the working precision is insufficient for the specified 
precision goal; the integrand is highly oscillatory or it is not a (piecewise) 
smooth function; or the true value of the integral is 0. Increasing the value of
 the GlobalAdaptive option MaxErrorIncreases might lead to a convergent 
numerical integration. NIntegrate obtained 30.14615590437465 and 
0.0001823733624988688 for the integral and error estimates.

Out(2)= 30.1462

This seems to indicate that one can trust the result of NIntegrate if the error estimate is a small percentage (~1%) of the estimated value of the integral. If that’s true then how would one understand the discrepancy in the values obtained in the following two cases when Mathematica does not report any errors.

In(102):= NIntegrate( Exp(-a^2 - b^2 - c^2 - x^2 + y^2), {x, -2, 2}, {y, -2, 2}, {a, -2, 2}, {b, -2, 2}, {c, -2, 2}, Method -> "AdaptiveMonteCarlo") // N

Out(102)= 298.918

In(104):= NIntegrate( Exp(-a^2 - b^2 - c^2 - x^2 + y^2), {x, -2, 2}, {y, -2, 2}, {a, -2, 2}, {b, -2, 2}, {c, -2, 2}, Method -> "MonteCarloRule") // N

Out(104)= 313.592

In the following example, I also get a result with an error bar that is a small (~2%) percentage of the value of the integral

In(7):= NIntegrate( Exp(-a^2 - b^2 - c^2 - x^2 - y^2 - z^2), {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, {a, -5, 5}, {b, -5, 5}, {c, -5, 5}, Method -> "AdaptiveQuasiMonteCarlo") // N

During evaluation of In(7):= NIntegrate::maxp: The integral failed to converge 
after 1000100 integrand evaluations. NIntegrate obtained 0.29686054547957375 and 
0.005304460608762476 for the integral and error estimates.

Out(7)= 0.296861

but comparing it with the following analytic evaluation of the integral

Out(8)= 31.0063

we see that the answer is way off. Any guidance in this regard will be greatly appreciated.

magento2.3 – Magento2 – How can we exend V1/products?searchCriteria to remove outofstock from the result

We are using Magento 2.3.5

When calling the V1/products?searchCriteria , the result contains out of stock items too.

We tried the filter option quantity_and_stock_status, but which is not working perfectly.
So is there any option to override the product collection in order to add stock condition with collection?

Tried with afterGetList by adding the stock condition, but the pagination getting wrong.

discrete mathematics – Relative Ranking – inflating values part of the same result set while maintaining some semblance of original distance

Data Definition:

A set of scores with size N of range(0 to 10) of decimal values:

(0.5, 0.8, 3.5, 8.5, 9.5, 9.9)


(7.7, 7.7, 7.7, 7.7, 7.7, 7.7, 7.7, 7.7, 7.7, 7.8)

Problem Definition:

A company has access to a simulation that audits products and spits out a score for each product ranging from 0 to 10. E.g the score of 5 for product ‘X’ will provide the following rating to a customer.

enter image description here

The company wants to ammend the score to do two things:

  1. Inflate results via relative ranking. Each score should fit closer to 10 even though its real score is not necessarily 10.
  2. Capture distance between low and high scores while maintaining point #1. E.g. fitting the top result as 10, second result as 9, third result as 8 etc.. would not be acceptable as the distance is lost here.

Hence I am trying to come up with a function s = f(o) where s is the relative score and o is the original or absolute score for this set.

What would be a good approach or function to accomplish this?

I can provide more details or answer any questions if needed

Why Coming in Search Result

Hi Guys,

I just noticed that every post from Mashable site is coming in search result as well as the same post coming in top of search result via

Why this result is coming in Google? it's just a redirection to original post and if its coming in Google result. Why not results from my blog feeds are coming ?

Why only Mashable? I did not see it for any other site.