>     Q1i = A/3

This is wrong.  It should be 

    Q1i = A * 3 / 12 

or 

    Q1i = A / 4

Now, to get back to self-employment tax.  Self-employment tax is weird.  It's a business tax.  From the IRS perspective, any self-employed person is a business.  So, take your income `X` and divide by 1.0765 (6.2% Social Security and 1.45% Medicare).  This gives your personal income.  Now, to calculate the tax that you have to pay, multiply that by .153 (since you have to pay both the worker and employer shares of the tax).  

So new calculation 

    Q1pi = Q1i / 1.0765

or they actually let you do 

    Q1pi = Q1i * .9235

which is better for you (smaller).  

And your other calculations change apace.  

    Q1ft = (10% * 9275) + (15% * (37650-9275)) + (25% * (Q1pi-3750))
    Q1se = (6.2% * Q1pi) + (1.45% * Q1pi) + (6.2% * Q1pi) + (1.45% * Q1pi)

And like I said, you can simplify `Q1se` to 

    Q1se = Q1pi * .153

and your payment would be 

    payment1 = Q1ft + Q1se

Now, to get to the second quarter.  Like I said, I'd calculate the income through the second quarter.  So recalculate `A` based on your new numbers and use that to calculate `Q2i`.  

    Q2i = A * (3 + 3) / 12

or 

    Q2i = A / 2

Note that this includes income from both the first and second quarters.  We'll reduce to just the second quarter later.  This also has you paying for all of June even though you may not have been paid when you make the withholding payment.  That's what they want you to do.  

    Q2ft = (10% * 9275) + (15% * (37650-9275)) + (25% * (Q2pi-3750))
    Q2se = Q2pi * .153

But we aren't done yet.  Your actual payment should be 

    payment2 = Q2ft - Q1ft + Q2se - Q1se

or 

    payment2 = Q2ft + Q2se - payment1

Because `Q2ft` and `Q2se` are what you owe for the year so far.  `Q1ft + Q1se` is what you've already paid.  So you subtract those from what you need to pay in the second quarter.  In future quarters, this would be 

    Q3i = A * 3 / 4
    payment3 = Q3ft + Q3se - payment2 - payment1
    Q4i = A
    payment4 = Q4ft + Q4se - payment3 - payment2 - payment1

All that said, don't stress about it.  As a practical matter, so long as you don't owe [$1000 or more](https://www.irs.gov/publications/p505/ch04.html) when you file your actual tax return, they aren't going to care.  So just make sure that your total payments match by the payment you make January 15th.  

I'm not going to try to calculate for the state.  For one thing, I don't know if your state uses `Q1i` or `Q1pi` as its base.  Different states may have different rules on that.  If you can't figure it out, just use `Q1i`, as that's the bigger one.  Fix it when you file your annual return.  The difference in withholding is going to be relatively small anyway, less than 1% of your income.