$F = Formula("1/($a+1)*(sin x)**($a+1)");
with
or just replace that one line with:with
Context()->flags->set(reduceConstants=>0);
$a1 = $a + 1;
$F = Formula("1/$a1*(sin x)**($a1)");
$a1 = $a + 1;
$F = Formula("1/$a1*(sin x)**($a1)");
$F = Formula("(sin x)**($a+1)/($a+1)");
if you are OK with putting the denominator there.