(* This integral appears in the proof of the equivalence of the separation of variables and the Green function for the Dirichlet problem in half-space *)
Integrate[ q BesselJ[0,q x]Exp[-a q],{q,0,∞},Assumptions->{x>0,a>0}]

(* Solution by the Green function method of the Dirichlet problem in half space x>0 with the boundary condition Phi= 1 for |y|<1 && |z|<1 *)

Integrate[((x/(2π))/((((((y-yy))^2)+(z-zz)^2+(x^2)))^(3/2))) ,{yy,-1,1},{zz,-1,1},Assumptions->{x>0,y>0,z>0}]

ff[x_,y_,z_]:=(1/(2π))ArcTan[(((-1+y) (-1+z))/(x (Sqrt[2+(x^2)-2 y+(y^2)-2 z+(z^2)])))]-(1/(2π))ArcTan[(((1+y) (-1+z))/(x (Sqrt[2+(x^2)+2 y+(y^2)-2 z+(z^2)])))]-(1/(2π))ArcTan[(((-1+y) (1+z))/(x (Sqrt[2+(x^2)-2 y+(y^2)+2 z+(z^2)])))]+(1/(2π))ArcTan[(((1+y) (1+z))/(x (Sqrt[2+(x^2)+2 y+(y^2)+2 z+(z^2)])))]

(* Check that it is a solution, i.e. it satisfies the Laplace equation for x>0 *)
D[ff[x,y,z],{x,2}]+D[ff[x,y,z],{y,2}]+D[ff[x,y,z],{z,2}]//FullSimplify

(* Graphycal representation of the solution *)
Plot3D[ff[0.1,y,z],{y,-4,4},{z,-4,4},PlotRange->All]
Plot3D[ff[0.5,y,z],{y,-4,4},{z,-4,4},PlotRange->All]
Plot3D[ff[2,y,z],{y,-4,4},{z,-4,4},PlotRange->All]

(* Electric field *)
Ex[x_,y_,z_]:=-D[ff[x,y,z],x]
Ey[x_,y_,z_]:=-D[ff[x,y,z],y]
Ez[x_,y_,z_]:=-D[ff[x,y,z],z]

-D[ff[x,y,z],x]

Ex[x_,y_,z_]:=-((-(((-1+y) (-1+z))/(((2+(x^2)-2 y+(y^2)-2 z+(z^2)))^(3/2)))-(((-1+y) (-1+z))/((x^2) (Sqrt[2+(x^2)-2 y+(y^2)-2 z+(z^2)]))))/(2 π (1+(((((-1+y))^2) (((-1+z))^2))/((x^2) (2+(x^2)-2 y+(y^2)-2 z+(z^2)))))))+((-(((1+y) (-1+z))/(((2+(x^2)+2 y+(y^2)-2 z+(z^2)))^(3/2)))-(((1+y) (-1+z))/((x^2) (Sqrt[2+(x^2)+2 y+(y^2)-2 z+(z^2)]))))/(2 π (1+(((((1+y))^2) (((-1+z))^2))/((x^2) (2+(x^2)+2 y+(y^2)-2 z+(z^2)))))))+((-(((-1+y) (1+z))/(((2+(x^2)-2 y+(y^2)+2 z+(z^2)))^(3/2)))-(((-1+y) (1+z))/((x^2) (Sqrt[2+(x^2)-2 y+(y^2)+2 z+(z^2)]))))/(2 π (1+(((((-1+y))^2) (((1+z))^2))/((x^2) (2+(x^2)-2 y+(y^2)+2 z+(z^2)))))))-((-(((1+y) (1+z))/(((2+(x^2)+2 y+(y^2)+2 z+(z^2)))^(3/2)))-(((1+y) (1+z))/((x^2) (Sqrt[2+(x^2)+2 y+(y^2)+2 z+(z^2)]))))/(2 π (1+(((((1+y))^2) (((1+z))^2))/((x^2) (2+(x^2)+2 y+(y^2)+2 z+(z^2)))))));

-D[ff[x,y,z],y]

Ey[x_,y_,z_]:=-((-(((-1+y) (-2+2 y) (-1+z))/(2 x (((2+(x^2)-2 y+(y^2)-2 z+(z^2)))^(3/2))))+((-1+z)/(x (Sqrt[2+(x^2)-2 y+(y^2)-2 z+(z^2)]))))/(2 π (1+(((((-1+y))^2) (((-1+z))^2))/((x^2) (2+(x^2)-2 y+(y^2)-2 z+(z^2)))))))+((-(((1+y) (2+2 y) (-1+z))/(2 x (((2+(x^2)+2 y+(y^2)-2 z+(z^2)))^(3/2))))+((-1+z)/(x (Sqrt[2+(x^2)+2 y+(y^2)-2 z+(z^2)]))))/(2 π (1+(((((1+y))^2) (((-1+z))^2))/((x^2) (2+(x^2)+2 y+(y^2)-2 z+(z^2)))))))+((-(((-1+y) (-2+2 y) (1+z))/(2 x (((2+(x^2)-2 y+(y^2)+2 z+(z^2)))^(3/2))))+((1+z)/(x (Sqrt[2+(x^2)-2 y+(y^2)+2 z+(z^2)]))))/(2 π (1+(((((-1+y))^2) (((1+z))^2))/((x^2) (2+(x^2)-2 y+(y^2)+2 z+(z^2)))))))-((-(((1+y) (2+2 y) (1+z))/(2 x (((2+(x^2)+2 y+(y^2)+2 z+(z^2)))^(3/2))))+((1+z)/(x (Sqrt[2+(x^2)+2 y+(y^2)+2 z+(z^2)]))))/(2 π (1+(((((1+y))^2) (((1+z))^2))/((x^2) (2+(x^2)+2 y+(y^2)+2 z+(z^2)))))));

-D[ff[x,y,z],z]

Ez[x_,y_,z_]:=-((-(((-1+y) (-1+z) (-2+2 z))/(2 x (((2+(x^2)-2 y+(y^2)-2 z+(z^2)))^(3/2))))+((-1+y)/(x (Sqrt[2+(x^2)-2 y+(y^2)-2 z+(z^2)]))))/(2 π (1+(((((-1+y))^2) (((-1+z))^2))/((x^2) (2+(x^2)-2 y+(y^2)-2 z+(z^2)))))))+((-(((1+y) (-1+z) (-2+2 z))/(2 x (((2+(x^2)+2 y+(y^2)-2 z+(z^2)))^(3/2))))+((1+y)/(x (Sqrt[2+(x^2)+2 y+(y^2)-2 z+(z^2)]))))/(2 π (1+(((((1+y))^2) (((-1+z))^2))/((x^2) (2+(x^2)+2 y+(y^2)-2 z+(z^2)))))))+((-(((-1+y) (1+z) (2+2 z))/(2 x (((2+(x^2)-2 y+(y^2)+2 z+(z^2)))^(3/2))))+((-1+y)/(x (Sqrt[2+(x^2)-2 y+(y^2)+2 z+(z^2)]))))/(2 π (1+(((((-1+y))^2) (((1+z))^2))/((x^2) (2+(x^2)-2 y+(y^2)+2 z+(z^2)))))))-((-(((1+y) (1+z) (2+2 z))/(2 x (((2+(x^2)+2 y+(y^2)+2 z+(z^2)))^(3/2))))+((1+y)/(x (Sqrt[2+(x^2)+2 y+(y^2)+2 z+(z^2)]))))/(2 π (1+(((((1+y))^2) (((1+z))^2))/((x^2) (2+(x^2)+2 y+(y^2)+2 z+(z^2)))))));

StreamPlot[{Ex[xs,0,za],Ez[xs,0,za]},{xs,0.1,5},{za,-5,5}]

(* Dirichlet Problem outside a sphere *)

(* Boundary Conditions *)
phi[ϕp_,θp_]:=HeavisideTheta[-θp+π/2]-HeavisideTheta[θp-π/2]

a=1.;x=1.01;ϕ=0.;
p1=Plot[(1/(4π))NIntegrate[((a(x^2 -a^2)Sin[θp])/(((x^2+a^2-2 a x (Cos[θ]Cos[θp]+Sin[θ]Sin[θp]Cos[ϕ-ϕp])))^((3/2))))  phi[ϕp,θp],{θp,0,π},{ϕp,0,2π}],{θ,0,π},{Evaluated->False,PlotStyle->Black}];
a=1.;x=1.2;ϕ=0.;
p2=Plot[(1/(4π))NIntegrate[((a(x^2 -a^2)Sin[θp])/(((x^2+a^2-2 a x (Cos[θ]Cos[θp]+Sin[θ]Sin[θp]Cos[ϕ-ϕp])))^((3/2))))  phi[ϕp,θp],{θp,0,π},{ϕp,0,2π}],{θ,0,π},{Evaluated->False,PlotStyle->Blue}];
a=1.;x=1.5;ϕ=0.;
p3=Plot[(1/(4π))NIntegrate[((a(x^2 -a^2)Sin[θp])/(((x^2+a^2-2 a x (Cos[θ]Cos[θp]+Sin[θ]Sin[θp]Cos[ϕ-ϕp])))^((3/2))))  phi[ϕp,θp],{θp,0,π},{ϕp,0,2π}],{θ,0,π},{Evaluated->False,PlotStyle->Red}];
a=1.;x=4;ϕ=0.;
p4=Plot[(1/(4π))NIntegrate[((a(x^2 -a^2)Sin[θp])/(((x^2+a^2-2 a x (Cos[θ]Cos[θp]+Sin[θ]Sin[θp]Cos[ϕ-ϕp])))^((3/2))))  phi[ϕp,θp],{θp,0,π},{ϕp,0,2π}],{θ,0,π},{Evaluated->False,PlotStyle->Green}];

Show[p1,p2,p3,p4]