I am using scrbook and some of my section and subsection header have small math in them.
There is no problem doing this, other than I noticed the headers have bold font (which is good and I want that to make the header easier to see in the document), but the math itself in the header is still light weight, same as if it was in the main text.
This makes the headers that contain math not look as good, since part of the header is bold now and part is not.
Here is a MWE. I use only lualatex if it makes any difference.
\documentclass[11pt]{scrbook}%
\usepackage{amsmath}
\usepackage{lmodern}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\chapter{My main Chapter is here}
\section{This solves $\int f(x) \,dx$ and more}
\subsection{This solves $u''(x)+u(x)=0$ for any $u(x)$ with initial conditions}
text here
\end{document}
When compiled using lualatex foo.tex, here is what the header look like

My question is, what is the correct way to make the whole section or subsection header use the same weight font (same boldness), including any math in it?
TL 2019 on linux
