I'm having some issues with the using of MathJax updating after the page refresh.
In particoular, I've created a HTML doc with a LaTex formula "$$ \int \sin (x) = $$" and a button. The button add a new LaTex formula ("$$\int \cos(x) $$") at the bottom of the page. When I run the page the first formula is correctly shown in LaTex format. But when I click the button, the first one is still correctly shown while the new one is not, even though I insert the call of MathJax.Hub.Queue(["Typeset",MathJax.Hub]) method.
I attach HTML, button javascript code and output. HTML:
function btt(){
$("#div2").append("$$\int \cos(x) $$");
MathJax.Hub.Queue(["Typeset",MathJax.Hub])
};
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<div id="div1"> $$ \int \sin (x) = $$
<button id= "btt" onclick= "btt()" name="a";> click! </button>
</div>
<div id="div2" class="container"> </div>

How can I show the second formula with a LaTex format? Thanks a lot.