12.如图,在$△ ABC$中,$AC=5,E$为$BC$边上一点,且$CE=1,AE=\sqrt{26},BE=4,F$为$AB$边上的动点,连接$EF$.
(1)求$AB$的长;
(2)当$△ BEF$为等腰三角形时,求$AF$的长.

答案:12.解:(1)$\because AC=5$,$CE=1$,$AE=\sqrt{26}$,
$\therefore AC^{2}+CE^{2}=26$,$AE^{2}=26$,
$\therefore AC^{2}+CE^{2}=AE^{2}$,$\therefore ∠ ACE=90°$.
$\because BC=CE+BE=5$,$AC=5$,
$\therefore AB=\sqrt{AC^{2}+BC^{2}}=\sqrt{5^{2}+5^{2}}=5\sqrt{2}$.
(2)①当$BF=BE=4$时,$AF=AB-BF=5\sqrt{2}-4$.
②如答图①,当$BF=EF$时,由(1)知$AC=BC$,$∠ C=$
$90°$,$\therefore ∠ B=45°$,$\therefore ∠ FEB=∠ B=45°$,
$\therefore ∠ BFE=90°$.
设$BF=EF=x$,
$\because BF^{2}+EF^{2}=BE^{2}$,$\therefore x^{2}+x^{2}=4^{2}$,
$\therefore x=2\sqrt{2}$(负值舍去),
$\therefore AF=AB-BF=5\sqrt{2}-2\sqrt{2}=3\sqrt{2}$.

③如答图②,当$BE=EF$时,有$∠ EFB=∠ B=45°$,
$\therefore ∠ BEF=90°$,$EF=BE=4$,
$\therefore BF=\sqrt{BE^{2}+EF^{2}}=4\sqrt{2}$,
$\therefore AF=AB-BF=5\sqrt{2}-4\sqrt{2}=\sqrt{2}$.
综上所述,$AF$的长为$5\sqrt{2}-4$或$3\sqrt{2}$或$\sqrt{2}$.