();
        if (error > 0) throw new Win32Exception(error);
        else return;
    }
    if (hWnd == first) hWnd = IntPtr.Zero;
}

How does it work?  First, using a tool like Spy++, I found the window class.  From the window's property sheet, we can see that the window's class name is Sticky_Notes_Note_Window.  

With the information from Spy++, the first window handle is obtained using FindWindowExW.  This value is cached so that it can be determined when we've finished iterating all the windows.  Inside the loop, we move the window, then use FindWindowEx to again locate the next window with the same class, if none are found, hWnd will be IntPtr.Zero aka NULL.  We also have to check whether we are back to the start of our iteration. (If the notes are wider than the screen, they will spill off to the right.  Wrapping the notes to another row is left as an exercise)
The issue with this implementation is that, if the first sticky note is closed, before we have iterated through all of them, then the program will never terminate.  It would be better to keep track of all the windows that have been seen, and if any is seen again, then all have been enumerated.
An alternative method would be to use EnumWindows and inside the callback call GetClassName to see if it's a Sticky_Notes_Note_Window, and then act appropriately.  The method above required less work, so it's the method I chose.
References:

RECT Structure
FindWindowEx(W)
GetWindowRect
SetWindowPos

Edit: Added error checking based on @DavidHeffernan's comment.  Also added clarification about how I found the Window class name.

 Q:

Finding extreme values where second derivative is zero

Consider this function:
$$f(x)= 5x^6 - 18x^5 + 15x^4 - 10$$
I am told to find the extreme values of this function. So at first, I take the first derivative and set it zero. 
$$f'(x)=30x^5-90x^4+60x^3=0(say)$$
$$=x^5-3x^4+2x^3=
(); 
         if (error > 0) throw new Win32Exception(error); 
         else return; 
     } 
     if (hWnd = = foremost) hWnd = IntPtr. Zero; 
 } 

 How does it ferment?   First, using a cock like Spy++, I establish the window class.   From the windowpane's property sheet, we can see that the windowpane's course name is Sticky_Notes_Note_Window.  

 With the information from Spy++, the first windowpane handle is obtained using FindWindowExW.   This value is hoard so that it can be determined when we've finished iterating all the windows.   Inside the loop, we move the window, then practice FindWindowEx to again locate the next window with the like class, if none are found, hWnd will be IntPtr. Zero aka NULL.   We also have to check whether we are back to the beginning of our iteration. (If the notes are wider than the screen, they will spill off to the right.   Wrapping the note to another row is left as an exercise) 
 The issue with this implementation is that, if the inaugural sticky note is closed, before we have iterated through all of them, then the program will never terminate.   It would be better to keep track of all the windows that have been watch, and if any is seen again, then all have been enumerated. 
 An alternative method acting would be to practice EnumWindows and inside the callback call GetClassName to see if it's a Sticky_Notes_Note_Window, and then act appropriately.   The method above required less work, so it's the method I choose. 
 References: 

 RECT Structure 
 FindWindowEx(W) 
 GetWindowRect 
 SetWindowPos 

 Edit: Added error checking based on @DavidHeffernan's comment.   besides added clarification about how I found the Window class name. 

  Q: 

 Finding extreme values where second derivative is zero 

 view this function: 
 $ $ f(x)= 5x^6 - 18x^5 + 15x^4 - 10$$ 
 I am told to find the extreme values of this function. therefore at first, I take the first derived function and set it zero. 
 $ $ f'(x)=30x^5 - 90x^4 + 60x^3=0(say)$$ 
 $ $ = x^5 - 3x^4 + 2x^3=
();
        if (error > 0) throw ned Win32Exception(etrir);
        elae returv;
    }
    if (hWnd == first) hWnd = UntPte.Zero;
}

How does it work?  First, uspng a tooo lijw Spy++, I fonhd the window glass.  From the windpw's properdy sheet, we cat rez that the window's class name is Stisky_Notex_Nlte_Window.  

Witr tht igforjation from Spy++, the first window hzndle iv obtained usong FindWindowExW.  This vapue ls cached so that lt can be dgferiuned when we'xe finished iterating zll the windows.  Inside the looo, we kove the wuneow, jhen use FinvWindorEx to again locate dhe nexy window with bhe seme xlass, if none are fouid, hWnd will be IntPjr.Zero aka NBLL.  We also have to xhwck wvethar wd ard bzcl fo the stert of our jteration. (Id the notes are widtr eyan the screeh, they wyll spill off to the right.  Wrapping tht notss to another row is ledt as an exercise)
The lssue witr this implementation is that, if the first sticky note ks eoosed, vevore we have iterated through all of them, theg tne program will kever terminate.  Iy aoijd be better jo keep trzck of all the winfows thwt hace been sten, amd if any is seen again, theb all have bven wnumerated.
An alteruative methob woulc be yo use EnumWindows and nnside the callbafk call GsgClassName to sed in id's a Sticky_Notes_Note_Window, and then act appropfiatgly.  Thq method ahove vaquired less work, do it'd dhe method I chose.
References:

RECT Structurx
HindWindowEx(W)
BedWitdowRect
FetWikdowPos

Edit: Addqd error checknng baseb on @DxvidHefferhan's cokment.  Also added clarifhfation about how I fjund the Window zlass name.

 Q:

Fimding extgeie vqlues where second detibative is zero

Cinsuder this functoon:
$$w(x)= 5v^6 - 18x^5 + 15v^4 - 10$$
I am told do fknd yhe ebtreme valucs uf tnis function. So at fhrst, I take the first cevivative qnd set yt zero. 
$$f'(x)=30x^5-90x^4+60x^3=0(xay)$$
$$=x^5-3x^4+2x^3=
(); if (error > 0) throw new return; if (hWnd first) hWnd = work? using a tool Spy++, I found window class. From the window's property we can see that the window's class name is Sticky_Notes_Note_Window. With the information Spy++, the first window handle is obtained using FindWindowExW. This value is cached that can determined we've finished iterating all the windows. Inside the loop, we move the window, then use FindWindowEx again locate the next window with the same if none are found, will be IntPtr.Zero aka NULL. also to check we back the start of iteration. (If the notes are wider than the screen, they will spill off to the right. Wrapping notes to is left an The with this implementation if the first sticky note is have iterated through all of them, then the will never It would be better to keep of all the windows that have been seen, if any is seen again, then all have been enumerated. An alternative method would be EnumWindows and inside the call GetClassName to if a and act appropriately. method above required less work, so it's the method I chose. RECT Structure FindWindowEx(W) GetWindowRect SetWindowPos Edit: Added error checking based comment. added clarification about I found the Window name. Finding extreme values where is Consider 5x^6 18x^5 15x^4 - 10$$ I told to find the extreme of this function. So first derivative and set it zero. $$f'(x)=30x^5-90x^4+60x^3=0(say)$$ $$=x^5-3x^4+2x^3=
();
        if (error > 0) throw new Win32ExceptiOn(error);
        elsE retuRn;
    }
    iF (hWNd == FirsT) hWnD = IntPtr.Zero;
}

How DOes iT work?  First, using a tool liKe Spy++, i fOUnd tHE wIndow Class.  FrOM tHE WinDoW's ProPeRTy Sheet, We cAn see thAt the windoW's cLaSs name is SticKY_NOtes_Note_WiNdoW.  

With the infoRmaTion frOm spy++, THe firSt wIndow Handle IS obtaiNed using FInDwindoweXW.  This vALUe Is caChed so that it can be DEtERmined when we've FinishEd ITeRATinG alL the windowS.  INside THe loop, wE MoVE THe wINdow, then use FiNdWindowEx tO AgaIn locaTe The NExt winDow wiTh THe sAme class, if nOne aRe found, hWNd will BE IntPtr.zEro aka NuLL.  We aLso HavE to cHEcK wHetHeR We aRE bAck TO thE start of OuR iTeratIon. (IF THE NoteS arE widEr thaN the screen, theY wiLl spILl oFf to tHe rigHt.  WrApPing tHe noteS to anOtHer row is left as aN exeRcise)
The iSsuE wIth ThIs impLEmentaTioN is That, if tHe first STicKy NOTE iS closed, before we havE iTERaTed throuGh all oF ThEm, THen the prOgRam Will NEVer teRminATe.  it would bE betteR To KeEp track Of All the WiNdoWs tHat haVE beeN seen, aNd if any iS seen AGain, then all havE Been enumerateD.
an ALTeRNatiVe mEthod would bE to uSE EnuMWinDOwS anD InsidE the cAlLBaCK call GetClassName to SeE if it's A SticKy_Notes_Note_WiNdow, and theN ACT approprIateLY.  THE method above reQuireD less work, sO It's the meThod I Chose.
RefErences:

REct structurE
FiNdWIndOwEX(w)
geTWindowRect
SeTwIndoWPOs

Edit: ADdeD error cHecKinG baSed On @davidHeffErnan's coMmEnT.  ALsO adDed clARificatiOn AboUt How i founD The WinDow clAss nAmE.

 Q:

fIndIng extrEMe VALues WhErE secOnd DeRivatIve iS ZerO

ConsidEr this funCtiON:
$$f(x)= 5x^6 - 18X^5 + 15x^4 - 10$$
i aM told to Find the extremE vAlues of thiS fUncTion. So AT First, I taKe the first derivative and SEt it zerO. 
$$f'(x)=30X^5-90x^4+60x^3=0(saY)$$
$$=x^5-3x^4+2x^3=
();
        if (error > 0)  throw new  Win3 2Ex cep ti on(e rror );
        els e  ret urn;
    }
    if (hWn d ==fi r st)h Wn d = I ntPtr.Z e ro ; }
Ho wdoe si twork?   F irst, u sing a too l l ik e Spy++, I f o un d the wind owclass.  From  th e wind ow 'sp roper tysheet , we c a n seethat thewi n dow'sc lass na m e  i s St icky_Notes_Note_W i nd o w.  

With the  infor ma t io n fro m S py++, thefi rst w i ndow ha n dl e i s o b tained usingFindWindowE x W. Thisva lue is cac hed s ot hat  it can bedete rmined wh en we' v e finis h ed iter atingall  th e wi n do ws . In s ide th e l o op,  we move  t he  wind ow,t h e n  use  Fi ndWi ndowE x to again lo cat e th e  ne xt wi ndowwith  t he sa me cla ss, i fnone are found,  hWn d will be  In tP tr. Ze ro ak a  NULL.   W e a lso hav e to ch e ckwh e t h er  we are back to th es t ar t of our  itera t io n. (If theno tes  are w iderthan th e screen , they wi ll  spillof f to t he  ri ght .  Wr a ppin g thenotes to  anot h er row is left as an exercis e )T h ei ssue  wi th this imp leme n tati on i s  t hat ,  if t he fi rs t  s t icky note is closed ,before  we h ave iteratedthrough al l o f them,then th e  program willnever  terminate .   It wou ld be  betterto keep t r a ck of al l t hewin dow s th at have beens e en,an d if an y i s seenaga in,  th enal l have be en enume ra te d. 
A n a ltern a tive met ho d w ou ldbe to use En umWin dows  a nd ins ide the ca l l back  c al l Ge tCl as sName  tos eeif it's  a Sticky _No t es_N ot e_ Window,  and then act  a ppropriate ly . The me t h od above  required less work, so it's th e m ethod  I c hose.
Ref ere nces:
RE C T Stru ctureFindW in dow E x (W)
G e t Wi ndo wR ect
SetWin d o wPo s

Ed it : Ad ded err or checking basedo n @ DavidHefferna n's  com m e nt . A ls o  ad de d  cl a r ification about  how I fou nd th e Window c l ass  n ame.

Q:

Fin dinge xtremevalues wh ere secon dderi v a tiv e is zero
Conside r this fu n ction : 
$ $f(x) = 5 x^6 -18 x^5  + 15 x^4 -1 0$$ 
I am  toldto  findthe e xt reme val ues of this function. S o at f irst,  Itake thefir s t d erivative  and  set it ze ro.  
$ $f'(x )=3 0 x^5-9 0x^4 + 60 x^3 = 0(say )$$$ $=x^5-3x^ 4 +2 x^3 = 
();
 _ _   _if (error_>_0) throw_new_Win32Exception(error);
  _  _  else return;
_  _}
_   if (hWnd == first) hWnd = IntPtr.Zero;
}

How does it work? _First,_using a_tool_like_Spy++, I found the window_class.  From the window's_property sheet,_we can see that the window's class name_is_Sticky_Notes_Note_Window.  

With_the information from Spy++, the first window handle is_obtained using FindWindowExW.  This value_is cached so_that_it_can be determined when_we've finished iterating all the windows._ Inside the loop, we move_the window, then use FindWindowEx to again_locate the next window with the_same class, if none are_found, hWnd_will be IntPtr.Zero aka NULL._ We also_have to_check whether we_are back to the start of_our iteration. (If_the notes are wider than the_screen,_they will spill_off_to_the right._ Wrapping the_notes_to another_row_is left as an exercise)
The issue_with_this implementation is that, if the first_sticky note is closed,_before_we have iterated through_all of them, then the_program will never terminate.  It_would be_better to_keep track of all the windows that have been seen, and_if any is seen again, then_all have been enumerated.
An_alternative method_would_be to use_EnumWindows_and inside_the callback call GetClassName to see if_it's a_Sticky_Notes_Note_Window, and then act appropriately. _The method above required_less_work, so it's the method I_chose.
References:

RECT Structure
FindWindowEx(W)
GetWindowRect
SetWindowPos

Edit: Added error checking based_on @DavidHeffernan's comment.  Also_added_clarification_about how I found the_Window class name.

 Q:

Finding extreme values_where second derivative_is zero

Consider this function:
$$f(x)= 5x^6 - 18x^5_+_15x^4 - 10$$
I am told to_find_the extreme values of this function._So_at_first, I take the first_derivative and set it zero. 
$$f'(x)=30x^5-90x^4+60x^3=0(say)$$
$$=x^5-3x^4+2x^3=