Question: creat Maple function as in MatLab

Hi everyone,
I was wondering how to create a function, as we create in MatLab, in Maple. Here is an example of MatLab function, that I should convert to Maple:

function Y=fsin(delta,b,n)

if n==0
    Y=1/(1+b^2);
end
if n==1
    Y=atan(1/b);
end
if n==2
    Y=1+log(b^2 + 1)/2-b*atan(1/b);
end
if n==3
    Y=0.5*(2*delta-3*b-2*b*log(b^2 + 1)/2+atan(1/b)*(b^2-1));
end
if n==4
    Y=(1/36)*(18*delta^2-36*delta*b+33*b^2-11+6*log(b^2 + 1)/2*(3*b^2-1)+6*b*atan(1/b)*(3-b^2));
end
if n==5
    Y=(1/72)*(24*delta^3-36*delta^2*b+12*delta*(3*b^2-1)+25*b-25*b^3+12*b*log(b^2 + 1)/2*(1-b^2)+3*atan(1/b)*...
        (1-6*b^2+b^4));
end
if n==6
    
    Y=(1/7200)*(1800*delta^4-2400*delta^2*b+600*delta^2*(3*b^2-1)+1200*b*delta*(1-b^2)+685*b^4-1370*b^2+137+...
        60*log(b^2 + 1)/2*(5*b^4-10*b^2+1)+60*b*atan(1/b)*(-5+10*b^2-b^4));
end
if n==7
    Y=(1/21600)*(4320*delta^5-5400*delta^4*b+1200*delta^3*(3*b^2-1)+...
        1800*delta^2*b*(1-b^2)+180*delta*(5*b^4-10*b^2+1)-441*b+1470*b^3-441*b^5+...
        60*b*log(b^2 + 1)/2*(-3*b^4+10*b^2-3)+30*atan(1/b)*(-1+15*b^2-15*b^4+b^6));
end
end

  Thank you,  

Please Wait...