FYI: Calculation in Mathematica
4th region of titration of a base B= A- with HCl
See attached Figure for notation

INITAL CONDITIONS help mass conservation

Initial volume v and molarity  or formality  m of base

vb = 0.1

mb =0.05

That makes  molbtotal  moles of b:(note these do not change becaus of the mass conservation, they can only  be in fomrm b or bh

molbtotal=vb mb

molbtotal = molb + molbh

In the region 4 we have 
total volume= va (added acid ) and volume vb initial volume of base

vHCl = va  =vCl

va=0.051

vtotal=va+vb

So the concentration of btotal = molbtotal /vtotal

btotal = vb mb/vtotal

The same is for Cl-.

mCl= 0.1

vCl= 0.051

moleCl= mCl* vCl

Concentration Cl = molCl/vtotal

cl = mCl*vCl/vtotal

But Cl- is the same as the H+ brougth by HCl ( charge balance)Note that Cl will be in charge balance with H+ (Assune that the rest is water).

H+ can be either "free " as H+  or "added' to HA which in our notation is HB = hb

Cl- =htotal= h+hb

cl=h + hb

Here,  hb is acid  concentration  and  h is H+concentration,   and b is base concentration. We do not know what they are but we know equillibrium expression for them

Ka= h * b/hb

SO LET US CHECK WHAT WE KNOW:

Ka= 2.51 10^-5

cl

btotal

AND WHAT RELATIONS WE HAVE

cl==h+hb

btotal==b+hb

Ka==h  b/ hb

AND WHAT WE NEED TO FIND
h  ,   hb    and b

We can use Mathematica Solve[]  syntax , symultaneous solution of 3 equations

Solve[{cl==h+hb,btotal==b+hb,Ka==h  b/ hb},{h,hb,b}]

CHECK ALWAYS FOR REAL POSITIVE VALUES

H+ concentration :

h=0.0012928647492535161`

pH is then

-Log[10,0.0012928647492535161`]

APPROXIMATIO, added extra strong acid HCl only
"what if we do not have b contribution

"then it is a strong acid exces to neutral

volume cl added=

0.001

mCl

va+vb

Concentration of H+

honly=mCl  0.001/(va+vb)

pH extra acid only:

-Log[10,honly]