Mathematics

Associated with Math.SE; for both general discussion & math qu...
Feb 16, 2023 15:37
@JaiSriKrishna I don't know, but I would look that up on a page for Binomial coefficients (the wiki page for example)
Feb 16, 2023 13:37
I think this is not worth a full question and I have the feeling the answer might be negative, so I decided to ask here:

Is it possible to write $\tanh(y(x)) \partial_x (x w(x) y'(x))$ as $\partial_x (something)$. The same way as for example:
$\tanh(y(x)) y'(x) = \partial_x ( \log(\cosh(y(x))$
 

 Wolfram Mathematica

Welcome! This is the main Mathematica chat room for mathematic...
Apr 2, 2022 09:56
and people use the search function
Apr 2, 2022 09:56
all the simple ones got answered?
Apr 1, 2022 07:06
Any ideas how to test whether the simplify thing is a bug?
Apr 1, 2022 07:06
@MichaelE2 that is something useful I learnt!
Mar 31, 2022 21:32
What does your last piece of code do?
Mar 31, 2022 21:31
Because I don't remember encoutering such terms before in my calcualtions (and I have been doing more or less the same type of stuff for years with Mathematica)
Mar 31, 2022 21:30
@MichaelE2 That is interesting. Can somebody check in older version of Mathematica (I am using 13)
Mar 31, 2022 08:14
in particular, it will be interesting whether executing that code in different versions of Mathematica always leaves Cos^2+SIn^2 like that
Mar 31, 2022 08:13
@JimB I know that TrigReduce and TrigExpand work. However, this is a small part of a ginormous expression to which I can't apply either, because then the whole expression becomes orders of magnitude larger and Mathematica takes ages to do anything with it, but I don't want to have to go through the expression and replace every occurrence of a trigonometric identity by hand.
Mar 30, 2022 18:15
I am not sure whether this is worth a question or I am just forgetting something, but Mathematica does not simplify the Cos^2+Sin^2 for me on Mathematica 13, Ubuntu 20.04
'FullSimplify[
Simplify[-(1/4) (Cos[\[Gamma]1]^2 + Sin[\[Gamma]1]^2) (-4 + x1^2 +
x2^2 + x3^2 + x4^2)]]'
Can somebody confirm that? Maybe even explain why?
Mar 26, 2022 09:43
I want to write notebooks (.nb), with all cells set to code, so that I can use the option for simulatenously saving a notebook (.nb) as an .m file as well, in the same folder. The reason I do this is because I then commit the .m files to a version control repo
Mar 26, 2022 09:40
is it possible to make the default option for code cells in all of Mathematica, irrespective of file extension, to be to wrap lines to page width. I saw the "Wrap at Window Width" option in the "Format" menu but that does not do anything, whether I apply it to a specific cell or click it the moment I open a new blank notebook. In fact, it gets reset to "Don't wrap" the moment I click somewhere else, irrespective of whether I selected another cell ot just clicked another dropdown menu button
Dec 16, 2021 18:53
I also have Indexed expressiosn which seem to be coutned differently, so at this stage I have no clue what other objects Mathematica counts differently, so I don't think I can use Depth with confidence
Dec 16, 2021 18:52
I was thinking of writing a question, but I don't even know where to start from, since I discovered that also inequalities are counted different than expressions without inequalities in them, so it is a bit of a mess and I don't know how to come up with a minimumal working example that encompasses all the issues I have.
Dec 16, 2021 17:23
So I see that Depth[{a<b}] gives 3, but Depth[{a<b/c}] gives 5. This is very undesirable for me. Can that be avoided?
Dec 16, 2021 17:21
in your example with f[e,d,f,g,t] in it, isn't the answer dictated by the presence of the sublists? That is, unless f[...] was a 2D list itself, the anwer won't change?
Dec 16, 2021 17:16
@b3m2a1 can you elaborate on this?
Dec 16, 2021 17:15
Ok, maybe I can make it work with inequalities. Certainly it seems to be less straightforward than if the elements were pure numbers or symbols
Dec 16, 2021 17:12
I am currently trying to understand the numbers Depth is giving me
Dec 16, 2021 17:11
I don't quite understand what you are saying, but the elements of my lists are inequalities
Dec 16, 2021 17:09
Checkign Depth right away, never heard of it
Dec 16, 2021 17:09
by irregular I mean something like {{a, b, c}, {e, d, f, g, t}, {t}}, for which Dimensions just returns 3, which would be the same result as for {a,b,c}
Dec 16, 2021 17:07
Hello everyone. I have been googling, but I can't even find the appropriate words to get borderline relevant results. I wonder whether there is a function in Mathematica that I can use to distinguish between 1D, 2D, 3D and so on lists. The lists can be irregular, which makes DImensions not suitable for the task
Aug 31, 2021 07:49
oh I see. How did you find that?
Aug 29, 2021 14:32
have there been any undocumented changes to how Export works for exporting graphics to pdf somewhere between 12.1 and 12.3.1. I just reran some code and the result was way worse than before. The official Export documentation page that it was last updated in 2019 with version 12, but I am not sure whether that will include small changes between minor versions and I don't know where to check this.
Aug 27, 2021 08:22
ok. I am asking to see if other people are having the issue or it might be on my side due to some weird icompatibility with a kernel drivers or something.
Aug 26, 2021 22:40
Hello guys, I recently upgraded from 12.1 to 12.3.1 and the front end seems very, very unstable, especially when opening/collapsing sections/subsections in a notebook. Anything bigger than a few screen scrolls will lead to a freeze of Mathematica that requires me to kill it. I am using Mathematica on Ubuntu. Has anybody experienced anything like that? I tried googling but nothing showed up.
Apr 23, 2021 20:08
Also, I have no clue how to pose this as a question on the website (that is, what title to use), hence why I am asking here
Apr 23, 2021 20:06
(the inequalities are not necessarily true, it is a random example I haven't checked whether they make sense, but that is not the point of the question)
Apr 23, 2021 20:04
Does somebody know how to convert

{1/2 < k6,
k6 <= Root[{-6 + #^2& , \
(-9) # - 90 #2 + 8 # #2^2 + 204 #2^3 + 64 # #2^4 + 40 #2^5& }, {2, 2}]
}

to

{1/2 < k6 &&
k6 <= Root[{-6 + #^2& , \
(-9) # - 90 #2 + 8 # #2^2 + 204 #2^3 + 64 # #2^4 + 40 #2^5& }, {2, 2}]
}

I tried replacements with the rule `{List->And}`. However, with `ReplaceAll` that ruins the `Root` object. With `Replace` I tried various possibilities for level specifications and they never change the expression, so I am not sure what I am missing.
Mar 13, 2021 22:15
or am I not nice enough to Mathematica to see it
Mar 13, 2021 22:14
Am I missing something?
Mar 13, 2021 22:14
All other terms are positive, since we have squares everywhere, so the inequality is false
Mar 13, 2021 22:14
They way I think about it is: The term with the highest power of x in the first bracket is x^(2n+2) and the one after is x^(2n) y^2 * constant. That constant is bigger or equal to 2 (since n is a positive integer - that is smallest value of n is 1). Since z is real and smaller than one, then the coefficient of the second term in the inequality is between 0 and -1. Hence whatever happens, the x^(2n) y^2 * constant from the first bracket will be larger than that term.
Mar 13, 2021 22:09
Hi guys.

I have an equation that I believe is always false given some assumptions.

Block[{$Assumptions =
n \[Element] Integers && n > 0 && {x, y, z} \[Element] Reals &&
z < 1}, FullSimplify[(y^2 + x^2)^(1 + n) +
y^2 x^(2 n) (-1 + z^2) < 0]]

Mathematica either does not agree with me, or I don't know how to make it see it. Any suggestions?
Feb 13, 2021 17:15
testFunc[var_, varVal_] := Block[{var = varVal}, Print[x + 5]]
testFunc[x, 3]
8
Feb 13, 2021 17:15
oops, the exmaple is wrong
Feb 13, 2021 17:07
does somebody know how I can pass a value and a variable to a function, so that it uses them inside a block

For example,

testFunc[var_, varVal_] := Block[{var = varVal}, Print[varVal + 5]]

marks `var` inside the `Block` in red. I need to do that, because I need to call the function with different values for different variables, but I want it all done locally, so it does not change the values of these variables outside the function
Feb 13, 2021 17:05
I use them when I need to lookup things which are not naturally ordered as 1,2,3 elements of a list. (For example arranging terms in equations according to how many derivatives are hitting the unknown functions, when not all possible number of derivatives are present)
Feb 13, 2021 17:04
Mathematica has a guide on associations
Feb 7, 2021 20:58
@halirutan thank you for your response. This helps a lot. I managed to get it working by wrapping every single word in Evaluate, but that is obviously just panic mode (I really needed it to just work on the spot). Thank you
Feb 6, 2021 16:01
oh, and the first vars inside Plot, in the first example does not need curly brackets
Feb 6, 2021 15:56
I really need to be able to do the first one, as I need to go over a table and the vars, eq and ineqs will change for each element
Feb 6, 2021 15:56
the above produces errors, whereas

Plot[5 x + 3, {x} \[Element] ImplicitRegion[x > 2 && x < 5, {x}]]

plots fine
Feb 6, 2021 15:55
Can somebody tell me why Mathematica fails to use Plot inside a Block

Block[{vars, eq, ineqs}, vars = Complement[{x, y, z}, {y, z}];
 eq = 5 x + 3; ineqs = x > 2 && x < 5;
 If[Length[vars] == 1,
  Plot[eq, {vars} \[Element] ImplicitRegion[ineqs, vars]]]]
Feb 5, 2021 18:17
probably it has to do with square roots being irrational numbers, hence in a software, they are always deep underneath some numerical approximation
Feb 5, 2021 18:15
I do a lot of maths in my life and the Root object in Mathematica is a black box to me