nt.number theory – Relation Between Schanuel’s Theorem and Class Number Equation

(Crossposted on math stack exchange: https://math.stackexchange.com/questions/4040249/relation-between-schanuels-theorem-and-class-number-equation)

It was recently brought to my attention that there is a striking similarity between the Class Number Formula and Schanuel’s Theorem. See for yourself:

Notation:
begin{align*}
&K, text{ number field}\
&d, text{ degree of $K$ over $mathbb{Q}$}\
&h_K, text{ class number of $K$}\
&R_K, text{ regulator of $K$}\
&D_K, text{ discriminant of $K$}\
&mu_K, text{ number of roots of unity contained in $K$}\
&r_1, text{ number of real places of $K$}\
&r_2, text{ number of complex places of $K$}\
&zeta_K(s), text{ Dedekind zeta function of $K$}\
&H_K(P), text{ height relative to $K$ on $mathbb{P}^n$}
end{align*}

Theorem (Class Number Formula)
$$lim_{sto 1}(s-1)zeta_K(s)=frac{h_K R_K 2^{r_1}(2pi)^{r_2}}{mu_K sqrt{|D_K|}}$$

Theorem (Schanuel’s Theorem)
begin{align*}
#{Pin mathbb{P}^n(K): H_K(P)leq T}=frac{h_K R_K}{mu_K zeta_K(n+1)}left(frac{2^{r_1} (2pi)^{r_2}}{sqrt{|D_K|}}right)^{n+1} (n+1)^{r_1+r_2-1}T^{n+1}+O(T^{n+1-1/d})
end{align*}

Both of these results can be proven using a geometry of numbers argument. So one reason for the similarity might simply be that they end up being answers to similar counting problems. But this is not very satisfying, and it would be nice to have a more conceptual reason that they are so similar.

Main Question: Is there an intuitive (or deep) reason that the analytic class number formula is so similar to the coefficient of the leading term in Schanuel’s Theorem?

Secondary Question: What other examples are there of values of $L$-functions showing up in main terms of asymptotics?

equation solving – Solve[] arbitrarily adding orders of magnitude which cancel?

Define the variables

m0 = .1349766;
mp = .13957018;
mX = (2 mp + 3 m0)/2;

Now suppose we wish to solve the following equation for equation Ep:

sols = Solve((2 E0 Ep - 4 (E0 + Ep) mX + 4 mX^2 + m0^2)/(Sqrt(Ep^2 - mp^2) Sqrt(E0^2 - m0^2)) == 1, Ep)

Then, Mathematica returns

{{Ep -> (1.07446*10^47 + E0 (-4.59436*10^47 + 4.42011*10^47 E0) -  0.5 Sqrt(-3.79456*10^92 + E0 (2.32699*10^93 + E0 (1.73795*10^94 + E0 (-1.27726*10^95 + 1.89274*10^95 E0)))))/(3.05309*10^47 + E0 (-8.84022*10^47 + 4.84611*10^47 E0))}, 
{Ep -> (1.07446*10^47 + E0 (-4.59436*10^47 + 4.42011*10^47 E0) + 0.5 Sqrt(-3.79456*10^92 + E0 (2.32699*10^93 + E0 (1.73795*10^94 + E0 (-1.27726*10^95 + 1.89274*10^95 E0)))))/(3.05309*10^47 + E0 (-8.84022*10^47 + 4.84611*10^47 E0))}}

which is fine, I guess. But, as you can see, it’s introduced a bunch of factors of $10^{47}$ which cancel everywhere. This seems to me to be totally meaningless and a huge hassle especially since none of my parameters are even remotely close to $10^{47}$, and FullSimplify doesn’t cancel the common factors for some reason.

So I guess my question is, how do I get Mathematica to stop introducing arbitrary factors of huge numbers in Solve()?

optimization – How to solve an optimisation equation with unknown parameters?

Given an example equation:

$$ z = Mx + Ny $$

where M, N are unknown parameters and x, y, z are features of a dataset.

My initial guess is to use gradient descent and the least squares error to obtain M and N from the dataset.

After that, we construct the inequality equations and apply these with the new equation (known M and N) to a Lagrange multiplier to minimise z.

Is this a correct approach to the problem?

How to Create a Shortcut to put a frame around an equation

I use mathematica for typing Physics and other notes. For important equations, I prefer to put a box around them. To do so I use either:

  • Insert-> Typesetting -> Add Frame from the menubar
  • Palette -> Writing Assistant -> Writing and Formatting -> Cell Properties -> Frame

This is tedious when you are rapidly taking notes. I desire to be able to assign the command(s) to a shortcut key. Is there a function or command that I could assign to a shortcut key?

performance tuning – Is there a better way : solutions to integer equation

I have the following code which solves for Integers the equation
$$a_1+a_2+a_3+a_4+b_1+b_2+b_3+b_4+c_1+c_2+c_3+c_4=tot$$
with
$$ -4<a_iin mathbb{Z}<4$$
$$ -7<b_iin mathbb{Z}<7$$
$$ -4<c_iin mathbb{Z}<4$$
Notice that the constraint on b is different

My method for the moment is the following :

1- find the solutions to
$$a+b+c=tot$$
with
$$ -13<a=sum a_i<13$$
$$ -25<b=sum b_i<25$$
$$ -13<c=sum c_i<13$$
I use this code to do it (forget about the nbLd argument, it’s zero for all you care), it gives a List of solutions.

Solutions(tot_, nbLd_: 0(*forget about nbLd, it's zero*)) := Block({},
   Values@
    Solve(a + b + c == tot && -13 < a < 13 && -25 + 6*nbLd < b < 
       25 - 6*nbLd && -13 < c < 13 , {a, b, c}, Integers));

2- I use these solutions to find the ${a_i},{b_i},{c_i}$ using IntegerPartitions and Permutations(see here) as well as Reap and Sow
to find all the solutions to the initial equation. (There is some additional formatting done with Flatten). I use this code to do it:

GenNodes(tot_) :=
  Block({partitions = Solutions(tot), temp},
   (Partition(Flatten(#), 2)) & /@ (*Formatting line*)
    Flatten(Table({#((1, j)), #((2, i)), #((3, k))}, {j, 
         Length(#((1)))}, {i, Length(#((2)))}, {k, 
         Length(#((3)))})(*with this Table line, 
       I cobine all the different a_i,b_i,
       c_i solutions to get all possible solutions, 
       I need all permutations*)& /@ (Reap((
            temp = {
              
              IntegerPartitions(#((1)), {4}, 
               Range(-3, 3)),(*a_i solutions*)
              
              IntegerPartitions(#((2)), {4}, 
               Range(-6, 6)),(*b_i solutions*)
              
              IntegerPartitions(#((3)), {4}, 
               Range(-3, 3))}; (*c_i solutions*)
            
            If(temp((1)) != {} && temp((2)) != {} && temp((3)) != {}, 
             Sow({Join @@ Permutations /@ temp((1)), 
               Join @@ Permutations /@ temp((2)), 
               Join @@ Permutations /@ temp((3))}), 
             Unevaluated(Sequence()))) & /@ partitions, e)((1))), 3));

The final result is for example :

In(82):= GenNodes(47)

Out(82)= {{{3, 3}, {3, 2}, {6, 6}, {6, 6}, {3, 3}, {3, 3}}, {{3, 
   3}, {2, 3}, {6, 6}, {6, 6}, {3, 3}, {3, 3}}, {{3, 2}, {3, 3}, {6, 
   6}, {6, 6}, {3, 3}, {3, 3}}, {{2, 3}, {3, 3}, {6, 6}, {6, 6}, {3, 
   3}, {3, 3}}, {{3, 3}, {3, 3}, {6, 6}, {6, 5}, {3, 3}, {3, 3}}, {{3,
    3}, {3, 3}, {6, 6}, {5, 6}, {3, 3}, {3, 3}}, {{3, 3}, {3, 3}, {6, 
   5}, {6, 6}, {3, 3}, {3, 3}}, {{3, 3}, {3, 3}, {5, 6}, {6, 6}, {3, 
   3}, {3, 3}}, {{3, 3}, {3, 3}, {6, 6}, {6, 6}, {3, 3}, {3, 2}}, {{3,
    3}, {3, 3}, {6, 6}, {6, 6}, {3, 3}, {2, 3}}, {{3, 3}, {3, 3}, {6, 
   6}, {6, 6}, {3, 2}, {3, 3}}, {{3, 3}, {3, 3}, {6, 6}, {6, 6}, {2, 
   3}, {3, 3}}}

Which, hopefully, are all the solutions to the initial equation for $tot=47$, formatted in a certain way.

My goal is to find the solutions of this equation for $tot =32$, as it is right now, my computer cannot do it. It freezes (I don’t really know why, I’m not an expert, I don’t understand why it can’t just do it slowly, it maybe a memory problem ? but it freezes super fast, so I don’t think it is. It would be helpful if someone could explain this to me !).

Question: basically, can you do it ?

Alternative question: Do yo have a better (memory usage wise or speed wise) way to find the solutions ? or to improve any of the steps?

I’ll take any advice

Note: Beware, for 32 the number of solutions is huge.

plotting – I want a numerical and analytical solution of boundry value 2nd order differential equation

My equation is
x”(t)=-k/m(x-Ut)———–(1)
with x(0)=1 and x'(0)=0.
I want to calculate exact and numerical solutions of eq. (1) by using above given boundary conditions. Also want to plot both solutions with different values of t, m, k and U.
Please help me in this regard.

Find all valid triplets in this equation

I’m trying to find all positive integer triplets a,b,c that satisfy this equation. Note r is a constant.
And 1 does exist: 23,13,121. Why is the result not found? Is there something wrong with the way I expressed the first expression?

For those with older versions of Mathematica, please replace “PositiveIntegers” with “Integers”.

eqn1 = FullSimplify({2*r^98 + 14*r^96 + 11*r^94 - r^50 + a*r^46 + b*r^44 + c*r^40 == r^100, r = Sqrt((Sqrt(53)/2) + 1.5) })

Out:
{2.25039*10^16 a + 4.37815*10^15 b + 1.65712*10^14 c == 0, 2.26717}

Table(FindInstance(eqn1, {a, b, c}, PositiveIntegers, 15))

Out:
FindInstance({2.25039*10^16 a + 4.37815*10^15 b + 1.65712*10^14 c == 0, 2.26717}, {a, b, c}, PositiveIntegers, 15)

Also: can it be solved outright?

Solve({2*r^98 + 14*r^96 + 11*r^94 - r^50 + a*r^46 + b*r^44 + c*r^40 == r^100, r = Sqrt((Sqrt(53)/2) + 1.5)}, {a, b, c})

Thanks in advance.

Solve an equation in mathematica without replacing the value of the parameter

Suppose I want to solve a simple equation in mathematica x-a=0.So I am writing the mathematica code for this as below:

Solve[x - a == 0, x]

So the output will be as below:

{{x -> a}}

Now suppose I have assigned a value for ‘a’ beforehand and then want to solve the same equation.So my code will look like below:

a = 1;
Solve[x - a == 0, x]

And the output in this case will be like below:

{{x -> 1}}

Now if I want an output in this case as {{x -> a}},what modification should I do in my code ?

Note: Clear[a] will work,but I don’t want to remove permanently the assigned value to a

equation solving – How do I work with Root objects?

To recover the third solution in Mathematica as is to explain why it is missing in the solution without extra conditions.

zeros=Reduce((3 - Cos(4 x)) (Sin(x) - Cos(x)) == 2 && x >= -2 π && 
   x <= 0, x) /. C(1) -> 0

(x == -((3 (Pi))/2) || x == -(Pi))

So the solution implicitly is the substitution for C1==0. This has to done by interpreting the periodicity of the trigonometric composition.

FunctionPeriod((3 - Cos(4 x)) (Sin(x) - Cos(x)), x)

2 (Pi)

That is too what the constant C1 is for in the solution of Solve and Reduce.

So getting the -Pi in the solution was a different interpretation in the question and is not an error.

zlist = List @@ zeros((All, 2));

This shows each period of the functions has two zero on the real axis.

Solve((3 - Cos(4*x))*(Sin(x) - Cos(x)) == 2, x)

output of Solve for the first question

This shows the constant C1 and this domain of C1. So there are as many solutions as the Integers are mighty.

The ConditionalExpression is much to advanced for beginners. In the Plot built-in it does not matter because Plot uses Through. That evaluates the ConditionalExpression on the choosen interval of the Plot. In the output of Mathematica, the substitution evaluates them too and this makes a choice of an interval in which the solution reside. Sinces most beginners courses in maths do not teach Complexes there are obsolete solutions.

zlist = List @@ zeros((All, 2))
zlist = Append(zlist, zlist + 2 π) // Flatten

Plot((3 - Cos(4 x)) (Sin(x) - Cos(x)) - 2, {x, -2 Pi, 2 Pi}, 
 Ticks -> {{-2 Pi, -Pi, 0, Pi, 2 Pi}, {-1, 1}}, 
 Epilog -> {Red, PointSize(0.01), Point(Thread({#, 0} &@zlist))})

Plot of the function and the zeros

With 12.0.0 I have no problems solving this input. Most probable source for beginners are token variables. Just use Clean or CleanAll on the variables or CleanAll(“Global`*”) or Quit and try again.

 ComplexPlot((3 - Cos(4*x))*(Sin(x) - Cos(x)) - 
  2, {x, -2 π - 2 π I, 2 π + 2 π I}, 
 Epilog -> {Red, PointSize(0.01), Point(Thread({#, 0} &@zlist))})

ComplexPlot and the zeros

For the second part of the question

Reduce(Tan(2 x) Tan(7 x) == 1, x, Reals)

solutions

FunctionPeriod(Tan(2 x) Tan(7 x), x)

(Pi)

Reduce is slightly easier to understand in the output compared to Solve.

Reduce contains Solve complete and the methods of Solve can restricted in Reduce with the option Method->Reduce Solve behave almost like Reduce. Instead of Solve Reduce is invoked.

In the documentation page of Reduce Wolfram Inc states that “For transcendental equations, Solve may not give all solutions:”. On the other side “Reduce does not solve equations that depend on branch cuts of Wolfram Language functions:”. So plot the function first and identify the problem.

Solve has much more options than Reduce in the documentation page. It is up to oneself to test their functionality in Reduce.

solt = Solve(Tan(2 x) Tan(7 x) == 1, x, Reals)
zert = solt((All, 1, 2)) /. C(1) -> 0 // List // Flatten
plo = Plot(Tan(2 x) Tan(7 x) - 1, {x, -1.0125 π, 1.0125 π}, 
  Epilog -> {Red, PointSize(0.02), Point(Thread({#, 0} &@zert))})

Plot of the given functions and the zeros

lip = ListPlot(
  Callout({# // N, 0}, #, 
     LeaderSize -> {{32, 135 (Degree), 6}, {5, 180 (Degree)}}) & /@ 
   zert, PlotMarkers -> Automatic, PlotTheme -> "Web");

Show(plo, lip, ImageSize -> 600, AspectRatio -> 1/4)

Annotated zeros for Tan( 2x) Tan( 7x) - 1

The substitution of the trigonometrics is a nice alternative. Both factors work brilliant and give a polynomial of fifth order.

equ1 = (3 - Cos(4 x)) (Sin(x) - Cos(x)) - 2 == 0;
equ2 = t == 3 - Cos(4 x);
Eliminate(TrigExpand({equ1, equ2}), x)

(* 16 t^2 – 4 t^4 + t^5 == 32 *)

Solve(16 t^2 - 4 t^4 + t^5 == 32, Reals)

(* {t -> 2} *)

The polynomial for the substitution of t == 3 – Cos(4 x) has only one solution.

Plot({16 t^2 - 4 t^4 + t^5, 32}, {t, -3, 3}, 
 Epilog -> {Red, PointSize(0.02), Point({2, 32})})

Plot

Reduce(-Cos(x) + Sin(x) == 1, x, Reals)
Solve(-Cos(x) + Sin(x) == 1, x, Reals)

(Element(C(1), Integers) && x == Pi/2 + 2*Pi*C(1)) || 
  (Element(C(1), Integers) && x == Pi + 2*Pi*C(1))


{{x -> ConditionalExpression(Pi/2 - 4*Pi*C(1), Element(C(1), Integers))}, 
  {x -> ConditionalExpression(2*(-(Pi/2) + 2*Pi*C(1)), Element(C(1), Integers))}, 
  {x -> ConditionalExpression(2*(Pi/2 + 2*Pi*C(1)), Element(C(1), Integers))}, 
  {x -> ConditionalExpression(Pi/2 - 2*(Pi + 2*Pi*C(1)), Element(C(1), Integers))}}

Reduce(3 - Cos(4 x) == 2, x, Reals)

Element(C(1), Integers) && x == (Pi*C(1))/2

Some examples:
Table((Pi*C)/2, {C, -6, 6})

(* {-3*Pi, -((5*Pi)/2), -2*Pi, -((3*Pi)/2), -Pi, -(Pi/2), 0, Pi/2, Pi, (3*Pi)/2, 2*Pi, 
  (5*Pi)/2, 3*Pi} *)

The cause is 4 is even and this means the zeros of both factors match.

Mathematica stays a little back on Root object and representation of numbers in terms of trigonometrics for example. This question might help further in this and other problems, transform root objects into trigonometric expressions. Especially the robust approach in the AskConstants package AskConstants download and AskConstants WTC presentation on Youtube. This package is free and the user are professional Mathematica users at the University of Hawaii.